Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce control plane readiness before SA creation #2760

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/cfn/manager/create_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package manager
import (
"fmt"

"github.com/pkg/errors"
api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
iamoidc "github.com/weaveworks/eksctl/pkg/iam/oidc"
"github.com/weaveworks/eksctl/pkg/kubernetes"
Expand Down Expand Up @@ -114,7 +115,10 @@ func (c *StackCollection) NewTasksToCreateIAMServiceAccounts(serviceAccounts []*
kubernetes: clientSetGetter,
call: func(clientSet kubernetes.Interface) error {
sa.SetAnnotations()
return kubernetes.MaybeCreateServiceAccountOrUpdateMetadata(clientSet, sa.ClusterIAMMeta.AsObjectMeta())
if err := kubernetes.MaybeCreateServiceAccountOrUpdateMetadata(clientSet, sa.ClusterIAMMeta.AsObjectMeta()); err != nil {
return errors.Wrapf(err, "failed to create service account %s", sa.NameString())
}
return nil
},
})

Expand Down
8 changes: 8 additions & 0 deletions pkg/eks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ func (c *ClusterProvider) appendCreateTasksForIAMServiceAccounts(cfg *api.Cluste
return err
}
*oidcPlaceholder = *oidc
// Make sure control plane is reachable
clientSet, err := c.NewStdClientSet(cfg)
if err != nil {
return errors.Wrap(err, "failed to get ClientSet")
}
if err := c.WaitForControlPlane(cfg.Metadata, clientSet); err != nil {
return errors.Wrap(err, "failed to wait for control plane")
}
return nil
},
})
Expand Down