-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move CAPI resources task using controller behind feature flag (#7420)
- Loading branch information
1 parent
6482f52
commit ea6ef64
Showing
3 changed files
with
64 additions
and
1 deletion.
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
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,35 @@ | ||
package management | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/aws/eks-anywhere/pkg/logger" | ||
"github.com/aws/eks-anywhere/pkg/task" | ||
"github.com/aws/eks-anywhere/pkg/types" | ||
"github.com/aws/eks-anywhere/pkg/workflows" | ||
) | ||
|
||
type moveClusterManagementTask struct{} | ||
|
||
func (s *moveClusterManagementTask) Run(ctx context.Context, commandContext *task.CommandContext) task.Task { | ||
logger.Info("Moving cluster management from bootstrap to workload cluster") | ||
err := commandContext.ClusterManager.MoveCAPI(ctx, commandContext.BootstrapCluster, commandContext.WorkloadCluster, commandContext.WorkloadCluster.Name, commandContext.ClusterSpec, types.WithNodeRef()) | ||
if err != nil { | ||
commandContext.SetError(err) | ||
return &workflows.CollectDiagnosticsTask{} | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (s *moveClusterManagementTask) Name() string { | ||
return "capi-management-move" | ||
} | ||
|
||
func (s *moveClusterManagementTask) Restore(ctx context.Context, commandContext *task.CommandContext, completedTask *task.CompletedTask) (task.Task, error) { | ||
return nil, nil | ||
} | ||
|
||
func (s *moveClusterManagementTask) 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