-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add git ops manager task for workload cluster
- Loading branch information
1 parent
d19c5de
commit 848abd7
Showing
3 changed files
with
86 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package workload | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/aws/eks-anywhere/pkg/cluster" | ||
"github.com/aws/eks-anywhere/pkg/logger" | ||
"github.com/aws/eks-anywhere/pkg/task" | ||
) | ||
|
||
type installGitOpsManagerTask struct{} | ||
|
||
func (s *installGitOpsManagerTask) Run(ctx context.Context, commandContext *task.CommandContext) task.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 { | ||
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 &writeClusterConfig{} | ||
} | ||
|
||
func (s *installGitOpsManagerTask) Name() string { | ||
return "gitops-manager-install" | ||
} | ||
|
||
func (s *installGitOpsManagerTask) Restore(ctx context.Context, commandContext *task.CommandContext, completedTask *task.CompletedTask) (task.Task, error) { | ||
return nil, nil | ||
} | ||
|
||
func (s *installGitOpsManagerTask) Checkpoint() *task.CompletedTask { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters