From 7c3a379e48455ffab3e574c83e81f0c8adca6fd1 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Thu, 8 Feb 2024 13:34:44 -0500 Subject: [PATCH] Fixes gatewayproxy controller tests for ent (#20543) fix tests for ent --- .../internal/controllers/gatewayproxy/controller_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/mesh/internal/controllers/gatewayproxy/controller_test.go b/internal/mesh/internal/controllers/gatewayproxy/controller_test.go index 920a4dbfc2..5789e9dcab 100644 --- a/internal/mesh/internal/controllers/gatewayproxy/controller_test.go +++ b/internal/mesh/internal/controllers/gatewayproxy/controller_test.go @@ -87,7 +87,7 @@ func (suite *gatewayproxyControllerSuite) TestReconciler_Reconcile() { require.NoError(t, err) - dec, err := resource.GetDecodedResource[*types.DecodedProxyStateTemplate](ctx, suite.client, id) + dec, err := resource.GetDecodedResource[*pbmesh.ProxyStateTemplate](ctx, suite.client, id) require.NoError(t, err) require.Nil(t, dec) }) @@ -115,6 +115,7 @@ func (suite *gatewayproxyControllerSuite) TestReconciler_Reconcile() { dec, err := resource.GetDecodedResource[*pbmesh.ProxyStateTemplate](ctx, suite.client, id) require.NoError(t, err) + require.NotNil(t, dec) require.Equal(t, dec.Id.Name, expectedWrittenResource.Id.Name) require.Equal(t, dec.Metadata, expectedWrittenResource.Metadata) require.Equal(t, dec.Owner.Name, expectedWrittenResource.Owner.Name) @@ -224,7 +225,7 @@ func (suite *gatewayproxyControllerSuite) setupSuiteWithTenancy(tenancy *pbresou Resource: &pbresource.Resource{ Id: &pbresource.ID{ Name: "mesh-gateway", - Tenancy: meshGWTenancy, + Tenancy: tenancy, }, Metadata: map[string]string{ GatewayKindMetadataKey: meshgateways.GatewayKind, @@ -234,7 +235,7 @@ func (suite *gatewayproxyControllerSuite) setupSuiteWithTenancy(tenancy *pbresou resourcetest.Resource(pbcatalog.WorkloadType, "mesh-gateway"). WithData(suite.T(), suite.meshgwWorkload.Data). - WithTenancy(meshGWTenancy). + WithTenancy(tenancy). WithMeta(GatewayKindMetadataKey, meshgateways.GatewayKind). Write(suite.T(), suite.client)