From dbac93d6e8539576773a085bd3033ac5085859b8 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Tue, 5 Jun 2018 13:57:23 +0100 Subject: [PATCH] Remove inlined prioritised TODOs and open issues --- cmd/eksctl/create.go | 10 +++------- pkg/eks/cfn.go | 22 ++-------------------- pkg/eks/eks.go | 8 +++----- 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/cmd/eksctl/create.go b/cmd/eksctl/create.go index f43dcf4a7d..35cd5ca788 100644 --- a/cmd/eksctl/create.go +++ b/cmd/eksctl/create.go @@ -67,7 +67,7 @@ func createClusterCmd() *cobra.Command { fs.StringVarP(&cfg.NodeType, "node-type", "t", DEFAULT_NODE_TYPE, "node instance type") fs.IntVarP(&cfg.Nodes, "nodes", "N", DEFAULT_NODE_COUNT, "total number of nodes (for a static ASG)") - // TODO(p2): review parameter validation, this shouldn't be needed initially + // TODO: https://github.com/weaveworks/eksctl/issues/28 fs.IntVarP(&cfg.MinNodes, "nodes-min", "m", 0, "maximum nodes in ASG") fs.IntVarP(&cfg.MaxNodes, "nodes-max", "M", 0, "minimum nodes in ASG") @@ -122,7 +122,7 @@ func doCreateCluster(cfg *eks.ClusterConfig) error { return err } - // TODO(p2): make kubeconfig writter merge with current default kubeconfig and respect KUBECONFIG env var for writing + // TODO: https://github.com/weaveworks/eksctl/issues/29 if writeKubeconfig { if err := clientConfigBase.WithExecHeptioAuthenticator().WriteToFile(kubeconfigPath); err != nil { return errors.Wrap(err, "writing kubeconfig") @@ -148,13 +148,9 @@ func doCreateCluster(cfg *eks.ClusterConfig) error { return err } - // TODO(p2): addons - // check kubectl version, and offer install instructions if missing or old // also check heptio-authenticator - // TODO(p2): and offer install instructions if missing - // TODO(p2): add sub-command for these checks - // TODO(p3): few more extensive checks, i.e. some basic validation + // TODO: https://github.com/weaveworks/eksctl/issues/30 if err := utils.CheckAllCommands(kubeconfigPath); err != nil { return err } diff --git a/pkg/eks/cfn.go b/pkg/eks/cfn.go index e8914057a7..e237bddd94 100644 --- a/pkg/eks/cfn.go +++ b/pkg/eks/cfn.go @@ -38,7 +38,6 @@ func (c *ClusterProvider) CreateStack(name string, templateBody []byte, paramete input.Parameters = append(input.Parameters, p) } - // TODO(p1): looks like we can block on this forever, if parameters are invalid logger.Debug("input = %#v", input) s, err := c.svc.cfn.CreateStack(input) if err != nil { @@ -47,13 +46,12 @@ func (c *ClusterProvider) CreateStack(name string, templateBody []byte, paramete logger.Debug("stack = %#v", s) go func() { - // TODO(eksctld): should probably use SNS notifications instead of polling ticker := time.NewTicker(20 * time.Second) defer ticker.Stop() defer close(errs) for { select { - // TODO(p1): timeout + // TODO: https://github.com/weaveworks/eksctl/issues/23 case <-ticker.C: s, err := c.describeStack(&name) if err != nil { @@ -69,22 +67,7 @@ func (c *ClusterProvider) CreateStack(name string, templateBody []byte, paramete stack <- *s return case cloudformation.StackStatusCreateFailed: - fallthrough - // TODO: technically, any of these may occur, but we may want to ignore some of these - // case cloudformation.StackStatusRollbackInProgress: - // case cloudformation.StackStatusRollbackFailed: - // case cloudformation.StackStatusRollbackComplete: - // case cloudformation.StackStatusDeleteInProgress: - // case cloudformation.StackStatusDeleteFailed: - // case cloudformation.StackStatusDeleteComplete: - // case cloudformation.StackStatusUpdateInProgress: - // case cloudformation.StackStatusUpdateCompleteCleanupInProgress: - // case cloudformation.StackStatusUpdateComplete: - // case cloudformation.StackStatusUpdateRollbackInProgress: - // case cloudformation.StackStatusUpdateRollbackFailed: - // case cloudformation.StackStatusUpdateRollbackCompleteCleanupInProgress: - // case cloudformation.StackStatusUpdateRollbackComplete: - // case cloudformation.StackStatusReviewInProgress: + fallthrough // TODO: https://github.com/weaveworks/eksctl/issues/24 default: errs <- fmt.Errorf("creating CloudFormation stack %q: %s", name, *s.StackStatus) // stack <- *s // this usually results in closed channel panic, but we don't need it really @@ -352,7 +335,6 @@ func (c *ClusterProvider) createStackDefaultNodeGroup(errs chan error) error { nodeInstanceRoleARN := GetOutput(&s, "NodeInstanceRole") if nodeInstanceRoleARN == nil { - // TODO(p2): confirm if this can actually block if key was wrong and find out why errs <- fmt.Errorf("NodeInstanceRole is nil") return } diff --git a/pkg/eks/eks.go b/pkg/eks/eks.go index b64d35aa16..95e7a353df 100644 --- a/pkg/eks/eks.go +++ b/pkg/eks/eks.go @@ -19,7 +19,6 @@ func (c *ClusterProvider) CreateControlPlane() error { RoleArn: &c.cfg.clusterRoleARN, Subnets: aws.StringSlice(strings.Split(c.cfg.subnetsList, ",")), SecurityGroups: aws.StringSlice([]string{c.cfg.securityGroup}), - // TODO(p1): find out why there are not tags } output, err := c.svc.eks.CreateCluster(input) if err != nil { @@ -73,7 +72,7 @@ func (c *ClusterProvider) createControlPlane(errs chan error) error { defer close(clusterChan) for { select { - // TODO(p1): timeout + // TODO: https://github.com/weaveworks/eksctl/issues/23 case <-ticker.C: cluster, err := c.DescribeControlPlane() if err != nil { @@ -124,8 +123,7 @@ func (c *ClusterProvider) ListClusters() error { return c.doListCluster(&c.cfg.ClusterName) } - // TODO(p1): collect results into a data structure (or at least a nicely formatted string) - // TODO(p2): paging + // TODO: https://github.com/weaveworks/eksctl/issues/27 input := &eks.ListClustersInput{} output, err := c.svc.eks.ListClusters(input) if err != nil { @@ -161,6 +159,6 @@ func (c *ClusterProvider) doListCluster(clusterName *string) error { } func (c *ClusterProvider) ListAllTaggedResources() error { - // TODO(p1): need this for showing any half-made clusters and pruning them + // TODO: https://github.com/weaveworks/eksctl/issues/26 return nil }