Skip to content

Commit

Permalink
Quick fix for nodegroup and iam sa not being updated, iamsa notbeing …
Browse files Browse the repository at this point in the history
…deleted on apply
  • Loading branch information
mumoshu committed Sep 17, 2020
1 parent b4374ed commit e668d81
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/resource/cluster/cluster_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ func (m *Manager) updateCluster(d *schema.ResourceData) error {

cluster, clusterConfig := set.Cluster, set.ClusterConfig

createNew := func(kind string, harmlessErrors []string) func() error {
createNew := func(kind string, extraArgs []string, harmlessErrors []string) func() error {
return func() error {
cmd, err := newEksctlCommand(cluster, "create", kind, "-f", "-")
args := []string{"create", kind, "-f", "-"}
args = append(args, extraArgs...)
cmd, err := newEksctlCommand(cluster, args...)
if err != nil {
return fmt.Errorf("creating eksctl-create command: %w", err)
}
Expand Down Expand Up @@ -154,13 +156,13 @@ func (m *Manager) updateCluster(d *schema.ResourceData) error {
}

tasks := []func() error{
createNew("nodegroup", nil),
createNew("nodegroup", nil, nil),
associateIAMOIDCProvider(),
createNew("iamserviceaccount", nil),
createNew("fargateprofile", harmlessFargateProfileCreationErrors),
createNew("iamserviceaccount", []string{"--approve"}, nil),
createNew("fargateprofile", nil, harmlessFargateProfileCreationErrors),
enableRepo(),
deleteMissing("nodegroup", []string{"--drain"}, nil),
deleteMissing("iamserviceaccount", nil, nil),
deleteMissing("nodegroup", []string{"--drain", "--approve"}, nil),
deleteMissing("iamserviceaccount", []string{"--approve"}, nil),
// eksctl delete fargate profile doens't has --only-missing command
//deleteMissing("fargateprofile", nil, []string{"Error: invalid Fargate profile: empty name"}),
applyKubernetesManifests(id),
Expand Down

0 comments on commit e668d81

Please sign in to comment.