Skip to content

Commit 1973f15

Browse files
authored
Fix failure when VPC CNI is configured to use both iam.withOIDC and useDefaultPodIdentityAssociations (#8268)
This reverts commit be999ef. Signed-off-by: Davanum Srinivas <[email protected]>
1 parent a7ee2ea commit 1973f15

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

pkg/actions/addon/tasks.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/weaveworks/eksctl/pkg/utils/tasks"
1919
)
2020

21-
func CreateAddonTasks(ctx context.Context, cfg *api.ClusterConfig, clusterProvider *eks.ClusterProvider, iamRoleCreator IAMRoleCreator, forceAll bool, timeout time.Duration, region string) (*tasks.TaskTree, *tasks.TaskTree, *tasks.GenericTask, []string) {
21+
func CreateAddonTasks(ctx context.Context, cfg *api.ClusterConfig, clusterProvider *eks.ClusterProvider, iamRoleCreator IAMRoleCreator, podIdentityIAMUpdater PodIdentityIAMUpdater, forceAll bool, timeout time.Duration, region string) (*tasks.TaskTree, *tasks.TaskTree, *tasks.GenericTask, []string) {
2222
var addons []*api.Addon
2323
var autoDefaultAddonNames []string
2424
if !cfg.AddonsConfig.DisableDefaultAddons {
@@ -97,7 +97,7 @@ func CreateAddonTasks(ctx context.Context, cfg *api.ClusterConfig, clusterProvid
9797
if err := addonManager.waitForAddonToBeActive(ctx, &api.Addon{Name: api.VPCCNIAddon}, api.DefaultWaitTimeout); err != nil {
9898
return fmt.Errorf("waiting for %q to become active: %w", api.VPCCNIAddon, err)
9999
}
100-
return addonManager.Update(ctx, vpcCNIAddon, nil, clusterProvider.AWSProvider.WaitTimeout())
100+
return addonManager.Update(ctx, vpcCNIAddon, podIdentityIAMUpdater, clusterProvider.AWSProvider.WaitTimeout())
101101
},
102102
}
103103
}

pkg/ctl/create/cluster.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,19 @@ func doCreateCluster(cmd *cmdutils.Cmd, ngFilter *filter.NodeGroupFilter, params
352352
ClusterName: cfg.Metadata.Name,
353353
StackCreator: stackManager,
354354
}
355-
preNodegroupAddons, postAddons, updateVPCCNITask, autoDefaultAddons := addon.CreateAddonTasks(ctx, cfg, ctl, iamRoleCreator, true, cmd.ProviderConfig.WaitTimeout, meta.Region)
355+
piaUpdater := &addon.PodIdentityAssociationUpdater{
356+
ClusterName: cmd.ClusterConfig.Metadata.Name,
357+
IAMRoleCreator: &podidentityassociation.IAMRoleCreator{
358+
ClusterName: cmd.ClusterConfig.Metadata.Name,
359+
StackCreator: stackManager,
360+
},
361+
IAMRoleUpdater: &podidentityassociation.IAMRoleUpdater{
362+
StackUpdater: stackManager,
363+
},
364+
EKSPodIdentityDescriber: ctl.AWSProvider.EKS(),
365+
StackDeleter: stackManager,
366+
}
367+
preNodegroupAddons, postAddons, updateVPCCNITask, autoDefaultAddons := addon.CreateAddonTasks(ctx, cfg, ctl, iamRoleCreator, piaUpdater, true, cmd.ProviderConfig.WaitTimeout, meta.Region)
356368
if len(autoDefaultAddons) > 0 {
357369
logger.Info("default addons %s were not specified, will install them as EKS addons", strings.Join(autoDefaultAddons, ", "))
358370
}

0 commit comments

Comments
 (0)