Skip to content

Commit

Permalink
fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TiberiuGC committed Nov 27, 2023
1 parent 289d048 commit 523cc4e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
3 changes: 1 addition & 2 deletions pkg/actions/addon/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ func CreateAddonTasks(ctx context.Context, cfg *api.ClusterConfig, clusterProvid
var preAddons []*api.Addon
var postAddons []*api.Addon
for _, addon := range cfg.Addons {
if strings.EqualFold(addon.Name, api.VPCCNIAddon) ||
strings.EqualFold(addon.Name, api.PodIdentityAgentAddon) {
if strings.EqualFold(addon.Name, api.VPCCNIAddon) {
preAddons = append(preAddons, addon)
} else {
postAddons = append(postAddons, addon)
Expand Down
17 changes: 13 additions & 4 deletions pkg/ctl/create/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/weaveworks/eksctl/pkg/actions/addon"
"github.com/weaveworks/eksctl/pkg/actions/flux"
"github.com/weaveworks/eksctl/pkg/actions/karpenter"
"github.com/weaveworks/eksctl/pkg/actions/podidentityassociation"
api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
"github.com/weaveworks/eksctl/pkg/authconfigmap"
"github.com/weaveworks/eksctl/pkg/cfn/manager"
Expand Down Expand Up @@ -340,17 +341,15 @@ func doCreateCluster(cmd *cmdutils.Cmd, ngFilter *filter.NodeGroupFilter, params
logger.Info("if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=%s --cluster=%s'", meta.Region, meta.Name)

eks.LogEnabledFeatures(cfg)
postClusterCreationTasks := ctl.CreateExtraClusterConfigTasks(ctx, cfg)

postClusterCreationTasks := tasks.TaskTree{}
var preNodegroupAddons, postNodegroupAddons *tasks.TaskTree
if len(cfg.Addons) > 0 {
preNodegroupAddons, postNodegroupAddons = addon.CreateAddonTasks(ctx, cfg, ctl, true, cmd.ProviderConfig.WaitTimeout)
postClusterCreationTasks.Append(preNodegroupAddons)
}

postClusterCreationTasks.Append(ctl.CreateExtraClusterConfigTasks(ctx, cfg))

taskTree := stackManager.NewTasksToCreateClusterWithNodeGroups(ctx, cfg.NodeGroups, cfg.ManagedNodeGroups, &postClusterCreationTasks)
taskTree := stackManager.NewTasksToCreateClusterWithNodeGroups(ctx, cfg.NodeGroups, cfg.ManagedNodeGroups, postClusterCreationTasks)

logger.Info(taskTree.Describe())
if errs := taskTree.DoAllSync(); len(errs) > 0 {
Expand Down Expand Up @@ -437,6 +436,16 @@ func doCreateCluster(cmd *cmdutils.Cmd, ngFilter *filter.NodeGroupFilter, params
}
}

if len(cfg.IAM.PodIdentityAssociations) > 0 {
if err := podidentityassociation.NewCreator(
cfg.Metadata.Name,
stackManager,
ctl.AWSProvider.EKS(),
).CreatePodIdentityAssociations(ctx, cfg.IAM.PodIdentityAssociations); err != nil {
return err
}
}

// After we have the cluster config and all the nodes are done, we install Karpenter if necessary.
if cfg.Karpenter != nil {
config := kubeconfig.NewForKubectl(cfg, eks.GetUsername(ctl.Status.IAMRoleARN), params.AuthenticatorRoleARN, ctl.AWSProvider.Profile().Name)
Expand Down
13 changes: 0 additions & 13 deletions pkg/eks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/weaveworks/eksctl/pkg/actions/iamidentitymapping"
"github.com/weaveworks/eksctl/pkg/actions/identityproviders"
"github.com/weaveworks/eksctl/pkg/actions/podidentityassociation"

"github.com/weaveworks/eksctl/pkg/windows"

Expand Down Expand Up @@ -314,18 +313,6 @@ func (c *ClusterProvider) CreateExtraClusterConfigTasks(ctx context.Context, cfg
})
}

if len(cfg.IAM.PodIdentityAssociations) > 0 {
piaTasks := tasks.TaskTree{
Parallel: true,
}
piaTasks.Append(podidentityassociation.NewCreator(
cfg.Metadata.Name,
c.NewStackManager(cfg),
c.AWSProvider.EKS(),
).CreateTasks(ctx, cfg.IAM.PodIdentityAssociations))
newTasks.Append(&piaTasks)
}

if cfg.HasWindowsNodeGroup() {
newTasks.Append(&WindowsIPAMTask{
Info: "enable Windows IP address management",
Expand Down

0 comments on commit 523cc4e

Please sign in to comment.