Skip to content

Commit af6d6d5

Browse files
authored
feat(kubernetes): add Plan field to Kubernetes cluster (#222)
1 parent 7acd043 commit af6d6d5

5 files changed

Lines changed: 7 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)
77

88
### Added
99
- new `Backups` field for `DeleteServerAndStoragesRequest` that controls if backups should be kept or deleted while deleting the server
10+
- Kubernetes cluster `Plan` field
1011

1112
## [6.0.0]
1213

upcloud/kubernetes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type KubernetesCluster struct {
3434
State KubernetesClusterState `json:"state"`
3535
UUID string `json:"uuid"`
3636
Zone string `json:"zone"`
37+
Plan string `json:"plan"`
3738
}
3839

3940
type KubernetesNodeGroup struct {

upcloud/kubernetes_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const exampleKubernetesClusterJSON string = `{
1414
"state": "running",
1515
"network": "03a98be3-7daa-443f-bb25-4bc6854b396c",
1616
"network_cidr": "172.16.0.0/24",
17+
"plan": "development",
1718
"node_groups": [
1819
{
1920
"name": "upcloud-go-sdk-unit-test",
@@ -103,6 +104,7 @@ func exampleKubernetesCluster() KubernetesCluster {
103104
State: KubernetesClusterStateRunning,
104105
UUID: "0ddab8f4-97c0-4222-91ba-85a4fff7499b",
105106
Zone: "de-fra1",
107+
Plan: "development",
106108
}
107109
}
108110

upcloud/request/kubernetes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type CreateKubernetesClusterRequest struct {
5353
NetworkCIDR string `json:"network_cidr"`
5454
NodeGroups []KubernetesNodeGroup `json:"node_groups"`
5555
Zone string `json:"zone"`
56+
Plan string `json:"plan,omitempty"`
5657
}
5758

5859
func (r *CreateKubernetesClusterRequest) RequestURL() string {

upcloud/request/kubernetes_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
const exampleCreateKubernetesClusterRequestJSON string = `{
1313
"network": "00000000-0000-0000-0000-000000000000",
1414
"network_cidr": "172.16.0.1/24",
15+
"plan": "production",
1516
"node_groups": [
1617
{
1718
"count": 1,
@@ -356,6 +357,7 @@ func exampleCreateKubernetesClusterRequest() CreateKubernetesClusterRequest {
356357
exampleKubernetesNodeGroup(),
357358
},
358359
Zone: "zone",
360+
Plan: "production",
359361
}
360362
}
361363

0 commit comments

Comments
 (0)