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

Update CLI logging output to be cluster type aware: #8231

Merged
merged 4 commits into from
Jul 13, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/eksctl-anywhere/cmd/createcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
err = createWorkloadCluster.Run(ctx, clusterSpec, createValidations)

} else if clusterSpec.Cluster.IsSelfManaged() {
logger.Info("Using the new workflow using the controller for management cluster create")
logger.V(1).Info("Using the eksa controller to create the management cluster")

Check warning on line 265 in cmd/eksctl-anywhere/cmd/createcluster.go

View check run for this annotation

Codecov / codecov/patch

cmd/eksctl-anywhere/cmd/createcluster.go#L265

Added line #L265 was not covered by tests

createMgmtCluster := management.NewCreate(
deps.Bootstrapper,
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflows/management/create_install_eksa.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (s *installEksaComponentsOnWorkloadTask) Run(ctx context.Context, commandCo
commandContext.ClusterSpec.Cluster.ClearTinkerbellIPAnnotation()
}

logger.Info("Installing EKS-A custom components on workload cluster")
logger.Info("Installing EKS-A custom components on the management cluster")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: initially the workload cluster in all these places meant wrt the kind cluster being the mgmt cluster vs the workload cluster getting created by the kind cluster.

Looks fine to me if we want to make this change tho since by this time we already would've moved the capi components.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe a new customer coming to eksa for the first time is going to grasp this implementation detail. They have asked for a management cluster and are now seeing logs about a workload cluster.

Copy link
Member Author

@jacobweinstock jacobweinstock Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think of the cognitive load we're requiring from a customers just to understand this one log line. They have to understand quite a lot of implementation details of how we create clusters. I believe that's an unreasonable expectation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it looks fine to me since for the customer can understand this better. When we use this statement for debugging the engineer can probably figure out which cluster we are talking about. LGTM!


err := installEKSAComponents(ctx, commandContext, commandContext.WorkloadCluster)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflows/management/create_move_capi.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (s *moveClusterManagementTask) Run(ctx context.Context, commandContext *tas
return &workflows.CollectDiagnosticsTask{}
}

logger.Info("Moving cluster management from bootstrap to workload cluster")
logger.Info("Moving the cluster management components from the bootstrap cluster to the management cluster")
err = commandContext.ClusterManager.MoveCAPI(ctx, commandContext.BootstrapCluster, commandContext.WorkloadCluster, commandContext.WorkloadCluster.Name, commandContext.ClusterSpec, types.WithNodeRef())
if err != nil {
commandContext.SetError(err)
Expand Down
6 changes: 3 additions & 3 deletions pkg/workflows/management/create_workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
type createWorkloadClusterTask struct{}

func (s *createWorkloadClusterTask) Run(ctx context.Context, commandContext *task.CommandContext) task.Task {
logger.Info("Creating new workload cluster")
logger.Info("Creating new management cluster")

commandContext.ClusterSpec.Cluster.AddManagedByCLIAnnotation()
commandContext.ClusterSpec.Cluster.SetManagementComponentsVersion(commandContext.ClusterSpec.EKSARelease.Spec.Version)
Expand Down Expand Up @@ -45,15 +45,15 @@ func (s *createWorkloadClusterTask) Run(ctx context.Context, commandContext *tas
return &workflows.CollectDiagnosticsTask{}
}

logger.Info("Installing cluster-api providers on workload cluster")
logger.Info("Installing cluster-api providers on management cluster")
managementComponents := cluster.ManagementComponentsFromBundles(commandContext.ClusterSpec.Bundles)
err = commandContext.ClusterManager.InstallCAPI(ctx, managementComponents, commandContext.ClusterSpec, commandContext.WorkloadCluster, commandContext.Provider)
if err != nil {
commandContext.SetError(err)
return &workflows.CollectDiagnosticsTask{}
}

logger.Info("Installing EKS-A secrets on workload cluster")
logger.Info("Installing EKS-A secrets on management cluster")
err = commandContext.Provider.UpdateSecrets(ctx, commandContext.WorkloadCluster, commandContext.ClusterSpec)
if err != nil {
commandContext.SetError(err)
Expand Down
Loading