Skip to content

Commit 1df0ac9

Browse files
fix for create pool (#343)
1 parent a479f78 commit 1df0ac9

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

cmd/kubernetes/kubernetes_nodepool_create.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ var kubernetesNodePoolCreateCmd = &cobra.Command{
4646
os.Exit(1)
4747
}
4848

49-
newPool := []civogo.KubernetesClusterPoolConfig{}
50-
for _, v := range kubernetesFindCluster.Pools {
51-
newPool = append(newPool, civogo.KubernetesClusterPoolConfig{ID: v.ID, Count: v.Count, Size: v.Size})
52-
}
53-
5449
var poolID string
5550
if nodePoolName != "" {
5651
poolID = nodePoolName
@@ -63,24 +58,18 @@ var kubernetesNodePoolCreateCmd = &cobra.Command{
6358
os.Exit(1)
6459
}
6560

66-
kcpc := civogo.KubernetesClusterPoolConfig{ID: poolID, Count: numTargetNodesPool, Size: targetNodesPoolSize}
61+
poolConfig := civogo.KubernetesClusterPoolConfig{ID: poolID, Count: numTargetNodesPool, Size: targetNodesPoolSize}
6762
if publicIpNodePool {
6863
if config.Current.RegionToFeatures != nil {
6964
if !config.Current.RegionToFeatures[client.Region].PublicIPNodePools {
7065
utility.Error("The region \"%s\" does not support \"Public IP Node Pools\" feature", client.Region)
7166
os.Exit(1)
7267
}
7368
}
74-
kcpc.PublicIPNodePool = publicIpNodePool
75-
}
76-
77-
newPool = append(newPool, kcpc)
78-
79-
configKubernetes := &civogo.KubernetesClusterConfig{
80-
Pools: newPool,
69+
poolConfig.PublicIPNodePool = publicIpNodePool
8170
}
8271

83-
kubernetesCluster, err := client.UpdateKubernetesCluster(kubernetesFindCluster.ID, configKubernetes)
72+
kubernetesCluster, err := client.CreateKubernetesPool(kubernetesFindCluster.ID, &poolConfig)
8473
if err != nil {
8574
utility.Error("%s", err)
8675
os.Exit(1)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
1010
github.com/briandowns/spinner v1.11.1
1111
github.com/c4milo/unpackit v0.0.0-20170704181138-4ed373e9ef1c // indirect
12-
github.com/civo/civogo v0.3.45
12+
github.com/civo/civogo v0.3.46
1313
github.com/dsnet/compress v0.0.1 // indirect
1414
github.com/fatih/color v1.13.0 // indirect
1515
github.com/google/go-github v17.0.0+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf
6161
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
6262
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
6363
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
64-
github.com/civo/civogo v0.3.45 h1:H9rrCKhO3vAQ249koZODdE/ESAXWAZQaYuQafqzJZr8=
65-
github.com/civo/civogo v0.3.45/go.mod h1:54lv/FOf7gh6wE9ZwVdw4yBehk8V1CvU9aWa4v6dvW0=
64+
github.com/civo/civogo v0.3.46 h1:F95+85P2sqM73bsJVQEgOmDTYCNMkg8uDL/dano6jTU=
65+
github.com/civo/civogo v0.3.46/go.mod h1:54lv/FOf7gh6wE9ZwVdw4yBehk8V1CvU9aWa4v6dvW0=
6666
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
6767
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
6868
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=

0 commit comments

Comments
 (0)