From 40dc546264f07bc8533934691762c6a903747324 Mon Sep 17 00:00:00 2001 From: Shawn Kaplan Date: Thu, 12 Oct 2023 11:58:39 -0700 Subject: [PATCH] Code cleanup --- pkg/aws/services/vpclattice.go | 2 +- pkg/deploy/lattice/access_log_subscription_manager.go | 2 +- pkg/deploy/lattice/access_log_subscription_manager_test.go | 6 +++--- ...og_policy_creation_test.go => access_log_policy_test.go} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename test/suites/integration/{access_log_policy_creation_test.go => access_log_policy_test.go} (100%) diff --git a/pkg/aws/services/vpclattice.go b/pkg/aws/services/vpclattice.go index 90f72717..73498030 100644 --- a/pkg/aws/services/vpclattice.go +++ b/pkg/aws/services/vpclattice.go @@ -30,7 +30,7 @@ type defaultLatticeServiceNameProvider struct { name string } -func NewLatticeServiceNameProvider(name string) LatticeServiceNameProvider { +func NewDefaultLatticeServiceNameProvider(name string) *defaultLatticeServiceNameProvider { return &defaultLatticeServiceNameProvider{ name: name, } diff --git a/pkg/deploy/lattice/access_log_subscription_manager.go b/pkg/deploy/lattice/access_log_subscription_manager.go index 300f2288..91d848b7 100644 --- a/pkg/deploy/lattice/access_log_subscription_manager.go +++ b/pkg/deploy/lattice/access_log_subscription_manager.go @@ -49,7 +49,7 @@ func (m *defaultAccessLogSubscriptionManager) Create( } resourceIdentifier = *serviceNetwork.SvcNetwork.Arn case lattice.ServiceSourceType: - serviceNameProvider := services.NewLatticeServiceNameProvider(accessLogSubscription.Spec.SourceName) + serviceNameProvider := services.NewDefaultLatticeServiceNameProvider(accessLogSubscription.Spec.SourceName) service, err := vpcLatticeSess.FindService(ctx, serviceNameProvider) if err != nil { return nil, err diff --git a/pkg/deploy/lattice/access_log_subscription_manager_test.go b/pkg/deploy/lattice/access_log_subscription_manager_test.go index 6a911fd5..a2d471ec 100644 --- a/pkg/deploy/lattice/access_log_subscription_manager_test.go +++ b/pkg/deploy/lattice/access_log_subscription_manager_test.go @@ -82,7 +82,7 @@ func Test_Create_NewAccessLogSubscriptionForService_ReturnsSuccess(t *testing.T) IsDeleted: false, }, } - serviceNameProvider := services.NewLatticeServiceNameProvider(sourceName) + serviceNameProvider := services.NewDefaultLatticeServiceNameProvider(sourceName) findServiceOutput := &vpclattice.ServiceSummary{ Arn: aws.String(serviceArn), Name: aws.String(sourceName), @@ -160,7 +160,7 @@ func Test_Create_NewAccessLogSubscriptionForDeletedService_ReturnsNotFoundError( IsDeleted: false, }, } - serviceNameProvider := services.NewLatticeServiceNameProvider(sourceName) + serviceNameProvider := services.NewDefaultLatticeServiceNameProvider(sourceName) findServiceOutput := &vpclattice.ServiceSummary{ Arn: aws.String(serviceArn), Name: aws.String(sourceName), @@ -380,7 +380,7 @@ func Test_Create_NewAccessLogSubscriptionForMissingService_ReturnsNotFoundError( }, } notFoundErr := services.NewNotFoundError("", "") - serviceNameProvider := services.NewLatticeServiceNameProvider(sourceName) + serviceNameProvider := services.NewDefaultLatticeServiceNameProvider(sourceName) mockLattice.EXPECT().FindService(ctx, serviceNameProvider).Return(nil, notFoundErr) mockCloud.EXPECT().Lattice().Return(mockLattice).AnyTimes() diff --git a/test/suites/integration/access_log_policy_creation_test.go b/test/suites/integration/access_log_policy_test.go similarity index 100% rename from test/suites/integration/access_log_policy_creation_test.go rename to test/suites/integration/access_log_policy_test.go