Skip to content

Commit

Permalink
Write AWS IAM kubeconfig file for workload cluster (#7596)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitalipaygude authored Feb 15, 2024
1 parent 7b6c4e8 commit 92e403d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/workflows/workload/writeclusterconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/aws/eks-anywhere/pkg/clustermarshaller"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/task"
"github.com/aws/eks-anywhere/pkg/workflows"
)

type writeClusterConfig struct{}
Expand All @@ -18,6 +19,15 @@ func (s *writeClusterConfig) Run(ctx context.Context, commandContext *task.Comma
commandContext.SetError(err)
}

if commandContext.ClusterSpec.AWSIamConfig != nil {
logger.Info("Generating the aws iam kubeconfig file")
err = commandContext.ClusterManager.GenerateAWSIAMKubeconfig(ctx, commandContext.ManagementCluster)
if err != nil {
commandContext.SetError(err)
return &workflows.CollectDiagnosticsTask{}
}
}

successMsg := ""
if commandContext.CurrentClusterSpec != nil {
successMsg = "Cluster upgraded!"
Expand Down

0 comments on commit 92e403d

Please sign in to comment.