Skip to content

Commit

Permalink
Improve log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Jan 6, 2019
1 parent 37fc0e5 commit d25af70
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 7 additions & 1 deletion pkg/ctl/create/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ func doCreateCluster(p *api.ProviderConfig, cfg *api.ClusterConfig, nameArg stri
if err := ctl.EnsureAMI(meta.Version, ng); err != nil {
return err
}
logger.Info("nodegroup %q will use %q [%s/%s]", ng.Name, ng.AMI, ng.AMIFamily, cfg.Metadata.Version)

// load or use SSH key - name includes cluster name and the
// fingerprint, so if unique keys provided, each will get
Expand All @@ -378,7 +379,12 @@ func doCreateCluster(p *api.ProviderConfig, cfg *api.ClusterConfig, nameArg stri

{ // core action
stackManager := ctl.NewStackManager(cfg)
logger.Info("will create 2 separate CloudFormation stacks for cluster itself and the initial nodegroup")
if len(cfg.NodeGroups) == 1 {
logger.Info("will create 2 separate CloudFormation stacks for cluster itself and the initial nodegroup")
} else {
logger.Info("will create a CloudFormation stack for cluster itself and %d nodegroup stack(s)", len(cfg.NodeGroups))

}
logger.Info("if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=%s --name=%s'", meta.Region, meta.Name)
errs := stackManager.CreateClusterWithNodeGroups()
// read any errors (it only gets non-nil errors)
Expand Down
2 changes: 0 additions & 2 deletions pkg/eks/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ func (c *ClusterProvider) EnsureAMI(version string, ng *api.NodeGroup) error {
return ami.NewErrNotFound(ng.AMI)
}

logger.Info("using %q for nodes", ng.AMI)

return nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/eks/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func getNodes(clientSet *clientset.Clientset, ng *api.NodeGroup) (int, error) {
if err != nil {
return 0, err
}
logger.Info("nodegroup %q has %d nodes", ng.Name, len(nodes.Items))
logger.Info("nodegroup %q has %d node(s)", ng.Name, len(nodes.Items))
for _, node := range nodes.Items {
// logger.Debug("node[%d]=%#v", n, node)
ready := "not ready"
Expand Down Expand Up @@ -96,7 +96,7 @@ func (c *ClusterProvider) WaitForNodes(clientSet *clientset.Clientset, ng *api.N
return errors.Wrap(err, "listing nodes")
}

logger.Info("waiting for at least %d nodes to become ready in %q", ng.MinSize, ng.Name)
logger.Info("waiting for at least %d node(s) to become ready in %q", ng.MinSize, ng.Name)
for !timeout && counter <= ng.MinSize {
select {
case event := <-watcher.ResultChan():
Expand Down

0 comments on commit d25af70

Please sign in to comment.