Skip to content

Commit

Permalink
chore: Update launch template provider to leverage interfaces (#6002)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Apr 9, 2024
1 parent af43cf8 commit aee00fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions pkg/providers/launchtemplate/launchtemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aee00fd

Please sign in to comment.