Fixes gatewayproxy controller tests for ent (#20543)

fix tests for ent
This commit is contained in:
John Maguire 2024-02-08 13:34:44 -05:00 committed by GitHub
parent b26282568f
commit 7c3a379e48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,7 +87,7 @@ func (suite *gatewayproxyControllerSuite) TestReconciler_Reconcile() {
require.NoError(t, err) 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.NoError(t, err)
require.Nil(t, dec) require.Nil(t, dec)
}) })
@ -115,6 +115,7 @@ func (suite *gatewayproxyControllerSuite) TestReconciler_Reconcile() {
dec, err := resource.GetDecodedResource[*pbmesh.ProxyStateTemplate](ctx, suite.client, id) dec, err := resource.GetDecodedResource[*pbmesh.ProxyStateTemplate](ctx, suite.client, id)
require.NoError(t, err) require.NoError(t, err)
require.NotNil(t, dec)
require.Equal(t, dec.Id.Name, expectedWrittenResource.Id.Name) require.Equal(t, dec.Id.Name, expectedWrittenResource.Id.Name)
require.Equal(t, dec.Metadata, expectedWrittenResource.Metadata) require.Equal(t, dec.Metadata, expectedWrittenResource.Metadata)
require.Equal(t, dec.Owner.Name, expectedWrittenResource.Owner.Name) require.Equal(t, dec.Owner.Name, expectedWrittenResource.Owner.Name)
@ -224,7 +225,7 @@ func (suite *gatewayproxyControllerSuite) setupSuiteWithTenancy(tenancy *pbresou
Resource: &pbresource.Resource{ Resource: &pbresource.Resource{
Id: &pbresource.ID{ Id: &pbresource.ID{
Name: "mesh-gateway", Name: "mesh-gateway",
Tenancy: meshGWTenancy, Tenancy: tenancy,
}, },
Metadata: map[string]string{ Metadata: map[string]string{
GatewayKindMetadataKey: meshgateways.GatewayKind, GatewayKindMetadataKey: meshgateways.GatewayKind,
@ -234,7 +235,7 @@ func (suite *gatewayproxyControllerSuite) setupSuiteWithTenancy(tenancy *pbresou
resourcetest.Resource(pbcatalog.WorkloadType, "mesh-gateway"). resourcetest.Resource(pbcatalog.WorkloadType, "mesh-gateway").
WithData(suite.T(), suite.meshgwWorkload.Data). WithData(suite.T(), suite.meshgwWorkload.Data).
WithTenancy(meshGWTenancy). WithTenancy(tenancy).
WithMeta(GatewayKindMetadataKey, meshgateways.GatewayKind). WithMeta(GatewayKindMetadataKey, meshgateways.GatewayKind).
Write(suite.T(), suite.client) Write(suite.T(), suite.client)