From aee00fd00128d05f515ada3ab25e2dc25294de23 Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Mon, 8 Apr 2024 17:52:02 -0700 Subject: [PATCH] chore: Update launch template provider to leverage interfaces (#6002) --- pkg/operator/operator.go | 2 +- pkg/providers/launchtemplate/launchtemplate.go | 10 +++++----- pkg/test/environment.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 316b9ac8229b..52de88629ce8 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -144,7 +144,7 @@ func NewOperator(ctx context.Context, operator *operator.Operator) (context.Cont versionProvider := version.NewDefaultProvider(operator.KubernetesInterface, cache.New(awscache.DefaultTTL, awscache.DefaultCleanupInterval)) amiProvider := amifamily.NewDefaultProvider(versionProvider, ssm.New(sess), ec2api, cache.New(awscache.DefaultTTL, awscache.DefaultCleanupInterval)) amiResolver := amifamily.NewResolver(amiProvider) - launchTemplateProvider := launchtemplate.NewProvider( + launchTemplateProvider := launchtemplate.NewDefaultProvider( ctx, cache.New(awscache.DefaultTTL, awscache.DefaultCleanupInterval), ec2api, diff --git a/pkg/providers/launchtemplate/launchtemplate.go b/pkg/providers/launchtemplate/launchtemplate.go index d53ee3803908..9589950f8fee 100644 --- a/pkg/providers/launchtemplate/launchtemplate.go +++ b/pkg/providers/launchtemplate/launchtemplate.go @@ -77,9 +77,9 @@ type DefaultProvider struct { ec2api ec2iface.EC2API eksapi eksiface.EKSAPI amiFamily *amifamily.Resolver - securityGroupProvider *securitygroup.DefaultProvider - subnetProvider *subnet.DefaultProvider - instanceProfileProvider *instanceprofile.DefaultProvider + securityGroupProvider securitygroup.Provider + subnetProvider subnet.Provider + instanceProfileProvider instanceprofile.Provider cache *cache.Cache cm *pretty.ChangeMonitor KubeDNSIP net.IP @@ -88,8 +88,8 @@ type DefaultProvider struct { ClusterCIDR atomic.Pointer[string] } -func NewProvider(ctx context.Context, cache *cache.Cache, ec2api ec2iface.EC2API, eksapi eksiface.EKSAPI, amiFamily *amifamily.Resolver, - securityGroupProvider *securitygroup.DefaultProvider, subnetProvider *subnet.DefaultProvider, instanceProfileProvider *instanceprofile.DefaultProvider, +func NewDefaultProvider(ctx context.Context, cache *cache.Cache, ec2api ec2iface.EC2API, eksapi eksiface.EKSAPI, amiFamily *amifamily.Resolver, + securityGroupProvider securitygroup.Provider, subnetProvider subnet.Provider, instanceProfileProvider instanceprofile.Provider, caBundle *string, startAsync <-chan struct{}, kubeDNSIP net.IP, clusterEndpoint string) *DefaultProvider { l := &DefaultProvider{ ec2api: ec2api, diff --git a/pkg/test/environment.go b/pkg/test/environment.go index b3750f7d41db..7f5c64db3674 100644 --- a/pkg/test/environment.go +++ b/pkg/test/environment.go @@ -108,7 +108,7 @@ func NewEnvironment(ctx context.Context, env *coretest.Environment) *Environment amiResolver := amifamily.NewResolver(amiProvider) instanceTypesProvider := instancetype.NewDefaultProvider(fake.DefaultRegion, instanceTypeCache, ec2api, subnetProvider, unavailableOfferingsCache, pricingProvider) launchTemplateProvider := - launchtemplate.NewProvider( + launchtemplate.NewDefaultProvider( ctx, launchTemplateCache, ec2api,