Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix count node pool update #204

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fake_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ func (c *FakeClient) UpdateKubernetesClusterPool(cid, pid string, config *Kubern
for _, p := range cs.Pools {
if p.ID == pid {
poolFound = true
p.Count = config.Count
p.Count = *config.Count
pool = p
}
}
Expand Down
2 changes: 1 addition & 1 deletion fake_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func TestKubernetesClustersPools(t *testing.T) {
g.Expect(string(result.Result)).To(Equal("success"))

pc := KubernetesClusterPoolUpdateConfig{
Count: 4,
Count: &[]int{4}[0],
}
pool, err = client.UpdateKubernetesClusterPool("9c89d8b9-463d-45f2-8928-455eb3f3726", "33de5de2-14fd-44ba-a621-f6efbeeb9639", &pc)
g.Expect(err).To(BeNil())
Expand Down
5 changes: 3 additions & 2 deletions pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"bytes"
"encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
"strings"

corev1 "k8s.io/api/core/v1"
)

// KubernetesClusterPoolUpdateConfig is used to create a new cluster pool
type KubernetesClusterPoolUpdateConfig struct {
ID string `json:"id,omitempty"`
Count int `json:"count,omitempty"`
Count *int `json:"count,omitempty"`
Size string `json:"size,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Taints []corev1.Taint `json:"taints"`
Expand Down
4 changes: 2 additions & 2 deletions pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestCreateKubernetesClusterPool(t *testing.T) {

newPool := &KubernetesClusterPoolUpdateConfig{
ID: "8a849cc5-bd51-45ce-814a-c378b09dcb06",
Count: 3,
Count: &[]int{3}[0],
Size: "g4s.kube.small",
Labels: map[string]string{},
Taints: []corev1.Taint{},
Expand Down Expand Up @@ -190,7 +190,7 @@ func TestUpdateKubernetesPool(t *testing.T) {
defer server.Close()

updatePool := &KubernetesClusterPoolUpdateConfig{
Count: 3,
Count: &[]int{3}[0],
Labels: map[string]string{
"label1": "label",
},
Expand Down
Loading