forked from aws/eks-anywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9443f91
commit 9cb8c74
Showing
9 changed files
with
270 additions
and
174 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
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
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 was deleted.
Oops, something went wrong.
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,63 @@ | ||
package workload | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/aws/eks-anywhere/pkg/cluster" | ||
"github.com/aws/eks-anywhere/pkg/filewriter" | ||
"github.com/aws/eks-anywhere/pkg/logger" | ||
"github.com/aws/eks-anywhere/pkg/providers" | ||
"github.com/aws/eks-anywhere/pkg/task" | ||
"github.com/aws/eks-anywhere/pkg/workflows/interfaces" | ||
) | ||
|
||
// CreateWorkload is a schema for create cluster. | ||
type CreateWorkload struct { | ||
provider providers.Provider | ||
clusterManager interfaces.ClusterManager | ||
gitOpsManager interfaces.GitOpsManager | ||
writer filewriter.FileWriter | ||
// eksaSpec []byte | ||
eksdInstaller interfaces.EksdInstaller | ||
clusterCreater interfaces.ClusterCreater | ||
packageInstaller interfaces.PackageInstaller | ||
} | ||
|
||
// NewCreateWorkload builds a new create construct. | ||
func NewCreateWorkload(provider providers.Provider, | ||
clusterManager interfaces.ClusterManager, gitOpsManager interfaces.GitOpsManager, | ||
writer filewriter.FileWriter, | ||
clusterCreate interfaces.ClusterCreater, | ||
eksdInstaller interfaces.EksdInstaller, | ||
packageInstaller interfaces.PackageInstaller, | ||
) *CreateWorkload { | ||
return &CreateWorkload{ | ||
provider: provider, | ||
clusterManager: clusterManager, | ||
gitOpsManager: gitOpsManager, | ||
writer: writer, | ||
eksdInstaller: eksdInstaller, | ||
clusterCreater: clusterCreate, | ||
packageInstaller: packageInstaller, | ||
} | ||
} | ||
|
||
func (c *CreateWorkload) Run(ctx context.Context, clusterSpec *cluster.Spec, validator interfaces.Validator) error { | ||
logger.Info("POC New workflow creating workload cluster using the controller") | ||
commandContext := &task.CommandContext{ | ||
Provider: c.provider, | ||
ClusterManager: c.clusterManager, | ||
GitOpsManager: c.gitOpsManager, | ||
ClusterSpec: clusterSpec, | ||
Writer: c.writer, | ||
Validations: validator, | ||
ManagementCluster: clusterSpec.ManagementCluster, | ||
ClusterCreater: c.clusterCreater, | ||
} | ||
|
||
// c.eksaSpec = eksaSpec | ||
|
||
err := task.NewTaskRunner(&SetAndValidateWorkloadTask{}, c.writer).RunTask(ctx, commandContext) | ||
|
||
return err | ||
} |
Oops, something went wrong.