Skip to content

Commit

Permalink
FIx
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone committed Jul 10, 2020
1 parent dcd5e92 commit 4203e38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 3 additions & 6 deletions internal/namespaces/k8s/v1/custom_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ import (

func Test_WaitCluster(t *testing.T) {
t.Run("wait for pools", core.Test(&core.TestConfig{
Commands: GetCommands(),
BeforeFunc: core.ExecStoreBeforeCmd(
"Cluster",
"scw k8s cluster create name=cli-test version=1.18.5 cni=cilium pools.0.node-type=DEV1-M pools.0.size=3 pools.0.name=default",
),
Cmd: "scw k8s cluster wait {{ .Cluster.ID }} wait-for-pools=true",
Commands: GetCommands(),
BeforeFunc: createCluster("Cluster", kapsuleVersion, 3),
Cmd: "scw k8s cluster wait {{ .Cluster.ID }} wait-for-pools=true",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckExitCode(0),
Expand Down
8 changes: 8 additions & 0 deletions internal/namespaces/k8s/v1/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ const (
// Clusters
//

// createCluster creates a basic cluster with "poolSize" dev1-m as nodes, the given version and
// register it in the context Meta at metaKey.
func createCluster(metaKey string, version string, poolSize int) core.BeforeFunc {
return core.ExecStoreBeforeCmd(
metaKey,
fmt.Sprintf("scw k8s cluster create name=cli-test version=%s cni=cilium pools.0.node-type=DEV1-M pools.0.size=%d pools.0.name=default", version, poolSize))
}

// createClusterAndWaitAndKubeconfig creates a basic cluster with 1 dev1-m as node, the given version and
// register it in the context Meta at metaKey.
func createClusterAndWaitAndKubeconfig(metaKey string, kubeconfigMetaKey string, version string) core.BeforeFunc {
Expand Down

0 comments on commit 4203e38

Please sign in to comment.