MCPcopy Create free account
hub / github.com/coder/coder / normalizeResources

Function normalizeResources

provisioner/terraform/provision_test.go:1204–1221  ·  view source on GitHub ↗
(resources []*proto.Resource)

Source from the content-addressed store, hash-verified

1202}
1203
1204func normalizeResources(resources []*proto.Resource) {
1205 for _, resource := range resources {
1206 sort.Slice(resource.Agents, func(i, j int) bool {
1207 return resource.Agents[i].Name < resource.Agents[j].Name
1208 })
1209
1210 for _, agent := range resource.Agents {
1211 agent.Id = ""
1212 if agent.GetToken() == "" {
1213 continue
1214 }
1215 agent.Auth = &proto.Agent_Token{}
1216 }
1217 }
1218 sort.Slice(resources, func(i, j int) bool {
1219 return resources[i].Name < resources[j].Name
1220 })
1221}
1222
1223// nolint:paralleltest
1224func TestProvision_ExtraEnv(t *testing.T) {

Callers 1

TestProvisionFunction · 0.85

Calls 1

GetTokenMethod · 0.45

Tested by

no test coverage detected