Skip to content

Commit

Permalink
chore: Remove instanceProfileProvider from the launchTemplateProvider (
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Apr 12, 2024
1 parent c8e8dc9 commit 3912ed2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
1 change: 0 additions & 1 deletion pkg/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ func NewOperator(ctx context.Context, operator *operator.Operator) (context.Cont
amiResolver,
securityGroupProvider,
subnetProvider,
instanceProfileProvider,
lo.Must(GetCABundle(ctx, operator.GetConfig())),
operator.Elected(),
kubeDNSIP,
Expand Down
47 changes: 22 additions & 25 deletions pkg/providers/launchtemplate/launchtemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import (
awserrors "github.com/aws/karpenter-provider-aws/pkg/errors"
"github.com/aws/karpenter-provider-aws/pkg/operator/options"
"github.com/aws/karpenter-provider-aws/pkg/providers/amifamily"
"github.com/aws/karpenter-provider-aws/pkg/providers/instanceprofile"
"github.com/aws/karpenter-provider-aws/pkg/providers/securitygroup"
"github.com/aws/karpenter-provider-aws/pkg/providers/subnet"
"github.com/aws/karpenter-provider-aws/pkg/utils"
Expand All @@ -71,35 +70,33 @@ type LaunchTemplate struct {

type DefaultProvider struct {
sync.Mutex
ec2api ec2iface.EC2API
eksapi eksiface.EKSAPI
amiFamily *amifamily.Resolver
securityGroupProvider securitygroup.Provider
subnetProvider subnet.Provider
instanceProfileProvider instanceprofile.Provider
cache *cache.Cache
cm *pretty.ChangeMonitor
KubeDNSIP net.IP
CABundle *string
ClusterEndpoint string
ClusterCIDR atomic.Pointer[string]
ec2api ec2iface.EC2API
eksapi eksiface.EKSAPI
amiFamily *amifamily.Resolver
securityGroupProvider securitygroup.Provider
subnetProvider subnet.Provider
cache *cache.Cache
cm *pretty.ChangeMonitor
KubeDNSIP net.IP
CABundle *string
ClusterEndpoint string
ClusterCIDR atomic.Pointer[string]
}

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,
securityGroupProvider securitygroup.Provider, subnetProvider subnet.Provider,
caBundle *string, startAsync <-chan struct{}, kubeDNSIP net.IP, clusterEndpoint string) *DefaultProvider {
l := &DefaultProvider{
ec2api: ec2api,
eksapi: eksapi,
amiFamily: amiFamily,
securityGroupProvider: securityGroupProvider,
subnetProvider: subnetProvider,
instanceProfileProvider: instanceProfileProvider,
cache: cache,
CABundle: caBundle,
cm: pretty.NewChangeMonitor(),
KubeDNSIP: kubeDNSIP,
ClusterEndpoint: clusterEndpoint,
ec2api: ec2api,
eksapi: eksapi,
amiFamily: amiFamily,
securityGroupProvider: securityGroupProvider,
subnetProvider: subnetProvider,
cache: cache,
CABundle: caBundle,
cm: pretty.NewChangeMonitor(),
KubeDNSIP: kubeDNSIP,
ClusterEndpoint: clusterEndpoint,
}
l.cache.OnEvicted(l.cachedEvictedFunc(ctx))
go func() {
Expand Down
1 change: 0 additions & 1 deletion pkg/test/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ func NewEnvironment(ctx context.Context, env *coretest.Environment) *Environment
amiResolver,
securityGroupProvider,
subnetProvider,
instanceProfileProvider,
ptr.String("ca-bundle"),
make(chan struct{}),
net.ParseIP("10.0.100.10"),
Expand Down

0 comments on commit 3912ed2

Please sign in to comment.