Skip to content

Commit

Permalink
Continue create workflow post gitops failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mitalipaygude committed Feb 9, 2024
1 parent 777272e commit 1a32c80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 1 addition & 3 deletions pkg/workflows/management/create_gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ func (s *installGitOpsManagerTask) Run(ctx context.Context, commandContext *task
logger.Info("Installing GitOps Toolkit on workload cluster")

managementComponents := cluster.ManagementComponentsFromBundles(commandContext.ClusterSpec.Bundles)
err := commandContext.GitOpsManager.InstallGitOps(ctx, commandContext.WorkloadCluster, managementComponents, commandContext.ClusterSpec, commandContext.Provider.DatacenterConfig(commandContext.ClusterSpec), commandContext.Provider.MachineConfigs(commandContext.ClusterSpec))
if err != nil {
if err := commandContext.GitOpsManager.InstallGitOps(ctx, commandContext.WorkloadCluster, managementComponents, commandContext.ClusterSpec, commandContext.Provider.DatacenterConfig(commandContext.ClusterSpec), commandContext.Provider.MachineConfigs(commandContext.ClusterSpec)); err != nil {
logger.MarkFail("Error when installing GitOps toolkits on workload cluster; EKS-A will continue with cluster creation, but GitOps will not be enabled", "error", err)
return nil
}
return &writeCreateClusterConfig{}
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/workflows/management/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,9 @@ func TestCreateGitOPsFailure(t *testing.T) {
test.gitOpsManager.EXPECT().InstallGitOps(
test.ctx, test.workloadCluster, test.managementComponents, test.clusterSpec, test.datacenterConfig, test.machineConfigs).Return(errors.New("test")),
)
test.expectWriteClusterConfig()
test.expectDeleteBootstrap(nil)
test.expectCuratedPackagesInstallation()

err := test.run()
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions pkg/workflows/management/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import (
"github.com/aws/eks-anywhere/pkg/workflows"
)

type updateSecrets struct{}
type updateSecretsCreate struct{}
type (
updateSecrets struct{}
updateSecretsCreate struct{}
)

// Run updateSecrets updates management cluster's secrets.
func (s *updateSecrets) Run(ctx context.Context, commandContext *task.CommandContext) task.Task {
Expand Down

0 comments on commit 1a32c80

Please sign in to comment.