diff --git a/test/integration/consul-container/libs/assert/envoy.go b/test/integration/consul-container/libs/assert/envoy.go index 35f9873741e2..076f2e1af62b 100644 --- a/test/integration/consul-container/libs/assert/envoy.go +++ b/test/integration/consul-container/libs/assert/envoy.go @@ -118,7 +118,7 @@ func AssertUpstreamEndpointStatusWithClient( clusterName, healthStatus) results, err := utils.JQFilter(clusters, filter) require.NoErrorf(r, err, "could not find cluster name %q: %v \n%s", clusterName, err, clusters) - require.Len(r, results, 1) // the final part of the pipeline is "length" which only ever returns 1 result + require.Len(r, results, 1, "clusters: "+clusters) // the final part of the pipeline is "length" which only ever returns 1 result result, err := strconv.Atoi(results[0]) assert.NoError(r, err) diff --git a/test/integration/consul-container/libs/assert/service.go b/test/integration/consul-container/libs/assert/service.go index 72e8ef06e705..7434a1d5e36f 100644 --- a/test/integration/consul-container/libs/assert/service.go +++ b/test/integration/consul-container/libs/assert/service.go @@ -63,7 +63,6 @@ func CatalogV2ServiceDoesNotExist(t *testing.T, client pbresource.ResourceServic // number of workload endpoints. func CatalogV2ServiceHasEndpointCount(t *testing.T, client pbresource.ResourceServiceClient, svc string, tenancy *pbresource.Tenancy, count int) { t.Helper() - require.False(t, count == 0) ctx := testutil.TestContext(t) retry.Run(t, func(r *retry.R) { diff --git a/testing/deployer/sprawl/catalog.go b/testing/deployer/sprawl/catalog.go index b4a14ca26b76..b19626ba7df2 100644 --- a/testing/deployer/sprawl/catalog.go +++ b/testing/deployer/sprawl/catalog.go @@ -196,8 +196,9 @@ func (s *Sprawl) registerServicesForDataplaneInstances(cluster *topology.Cluster if node.IsV2() { pending := serviceInstanceToResources(node, svc) - if _, ok := identityInfo[svc.ID]; !ok { - identityInfo[svc.ID] = pending.WorkloadIdentity + workloadID := topology.NewServiceID(svc.WorkloadIdentity, svc.ID.Namespace, svc.ID.Partition) + if _, ok := identityInfo[workloadID]; !ok { + identityInfo[workloadID] = pending.WorkloadIdentity } // Write workload @@ -545,15 +546,13 @@ func serviceInstanceToResources( }, }, } - - worloadIdentityRes = &Resource[*pbauth.WorkloadIdentity]{ + workloadIdentityRes = &Resource[*pbauth.WorkloadIdentity]{ Resource: &pbresource.Resource{ Id: &pbresource.ID{ Type: pbauth.WorkloadIdentityType, - Name: svc.ID.Name, + Name: svc.WorkloadIdentity, Tenancy: tenancy, }, - Metadata: svc.Meta, }, Data: &pbauth.WorkloadIdentity{}, } @@ -646,7 +645,7 @@ func serviceInstanceToResources( Workload: workloadRes, HealthStatuses: healthResList, Destinations: destinationsRes, - WorkloadIdentity: worloadIdentityRes, + WorkloadIdentity: workloadIdentityRes, ProxyConfiguration: proxyConfigRes, } } diff --git a/testing/deployer/topology/compile.go b/testing/deployer/topology/compile.go index fe12b1e0aeda..a3bbbe24e486 100644 --- a/testing/deployer/topology/compile.go +++ b/testing/deployer/topology/compile.go @@ -502,14 +502,14 @@ func compile(logger hclog.Logger, raw *Config, prev *Topology) (*Topology, error } } - if len(svc.WorkloadIdentities) == 0 { - svc.WorkloadIdentities = []string{svc.ID.Name} + if svc.WorkloadIdentity == "" { + svc.WorkloadIdentity = svc.ID.Name } } else { if len(svc.V2Services) > 0 { return nil, fmt.Errorf("cannot specify v2 services for v1") } - if len(svc.WorkloadIdentities) > 0 { + if svc.WorkloadIdentity != "" { return nil, fmt.Errorf("cannot specify workload identities for v1") } } diff --git a/testing/deployer/topology/topology.go b/testing/deployer/topology/topology.go index 11e85fd3c859..b59045b564b4 100644 --- a/testing/deployer/topology/topology.go +++ b/testing/deployer/topology/topology.go @@ -767,14 +767,14 @@ type Service struct { // This only applies for multi-port (v2). V2Services []string `json:",omitempty"` - // WorkloadIdentities contains named WorkloadIdentities to assign to this + // WorkloadIdentity contains named WorkloadIdentity to assign to this // workload. // // If omitted it is inferred that the ID.Name field is the singular // identity for this workload. // // This only applies for multi-port (v2). - WorkloadIdentities []string `json:",omitempty"` + WorkloadIdentity string `json:",omitempty"` Disabled bool `json:",omitempty"` // TODO