Skip to content

Commit d58c621

Browse files
feat(ske): add multi API version support (#5421)
relates to STACKITSDK-360 Co-authored-by: Ruben Hoenle <Ruben.Hoenle@stackit.cloud>
1 parent 739485d commit d58c621

File tree

145 files changed

+25132
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+25132
-75
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
- `sqlserverflex`: [v1.5.0](services/sqlserverflex/CHANGELOG.md#v150)
2525
- **Feature:** Introduction of multi API version support for the sqlserverflex SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
2626
- `v1api`: New package which can be used for communication with the sqlserverflex v1 API
27-
- `v2api`: New package which can be used for communication with the sqlserverflex v1 API
27+
- `v2api`: New package which can be used for communication with the sqlserverflex v2 API
2828
- `v3alpha1api`: New package which can be used for communication with the sqlserverflex v3 alpha1 API
2929
- `v3beta1api`: New package which can be used for communication with the sqlserverflex v3 beta1 API
3030
- **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead.
@@ -50,6 +50,12 @@
5050
- `v2betaapi`: New package which can be used for communication with the certificates v2 API
5151
- **Deprecation:** The contents in the root of this SDK module are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead.
5252
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
53+
- `ske`: [v1.8.0](services/ske/CHANGELOG.md#v180)
54+
- **Feature:** Introduction of multi API version support for the ske SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
55+
- `v1api`: New package which can be used for communication with the ske v1 API
56+
- `v2api`: New package which can be used for communication with the ske v2 API
57+
- **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead.
58+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
5359

5460
## Release (2026-02-20)
5561
- `core`: [v0.21.1](core/CHANGELOG.md#v0211)

examples/ske/go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ module github.com/stackitcloud/stackit-sdk-go/examples/ske
22

33
go 1.21
44

5+
// This is not needed in production. This is only here to point the golangci linter to the local version instead of the last release on GitHub.
6+
replace github.com/stackitcloud/stackit-sdk-go/services/ske => ../../services/ske
7+
58
require (
6-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1
9+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0
710
github.com/stackitcloud/stackit-sdk-go/services/ske v1.7.0
811
)
912

examples/ske/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
44
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
55
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
66
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
7-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts=
8-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=
9-
github.com/stackitcloud/stackit-sdk-go/services/ske v1.7.0 h1:l1QjxW7sdE/6B6BZtHxbmus8XJdI9KDuXX3fwUa5fog=
10-
github.com/stackitcloud/stackit-sdk-go/services/ske v1.7.0/go.mod h1:1Jr+ImrmPERxbYnlTy6O2aSZYNnREf2qQyysv6YC1RY=
7+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c=
8+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=

examples/ske/ske.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"os"
77

88
"github.com/stackitcloud/stackit-sdk-go/core/utils"
9-
"github.com/stackitcloud/stackit-sdk-go/services/ske"
10-
"github.com/stackitcloud/stackit-sdk-go/services/ske/wait"
9+
ske "github.com/stackitcloud/stackit-sdk-go/services/ske/v2api"
10+
"github.com/stackitcloud/stackit-sdk-go/services/ske/v2api/wait"
1111
)
1212

1313
func main() {
@@ -32,91 +32,91 @@ func main() {
3232
// }
3333

3434
// Get the ske clusters for your project
35-
getClustersResp, err := skeClient.ListClusters(context.Background(), projectId, region).Execute()
35+
getClustersResp, err := skeClient.DefaultAPI.ListClusters(context.Background(), projectId, region).Execute()
3636
if err != nil {
3737
fmt.Fprintf(os.Stderr, "Error when calling `GetClusters`: %v\n", err)
3838
} else {
39-
fmt.Printf("Number of clusters: %v\n", len(*getClustersResp.Items))
39+
fmt.Printf("Number of clusters: %v\n", len(getClustersResp.Items))
4040
}
4141

4242
var availableVersion string
4343
// Get the ske provider options
44-
getOptionsResp, err := skeClient.ListProviderOptions(context.Background(), region).Execute()
44+
getOptionsResp, err := skeClient.DefaultAPI.ListProviderOptions(context.Background(), region).Execute()
4545
if err != nil {
4646
fmt.Fprintf(os.Stderr, "Error when calling `GetOptions`: %v\n", err)
4747
} else {
48-
availableVersions := *getOptionsResp.KubernetesVersions
48+
availableVersions := getOptionsResp.KubernetesVersions
4949
availableVersion = *availableVersions[0].Version
5050
fmt.Printf("First available version: %v\n", availableVersion)
5151
}
5252

5353
// Create an ske cluster
5454
createInstancePayload := ske.CreateOrUpdateClusterPayload{
55-
Kubernetes: &ske.Kubernetes{
56-
Version: utils.Ptr(availableVersion),
55+
Kubernetes: ske.Kubernetes{
56+
Version: availableVersion,
5757
},
58-
Nodepools: &[]ske.Nodepool{
58+
Nodepools: []ske.Nodepool{
5959
{
60-
AvailabilityZones: utils.Ptr([]string{"eu01-3"}),
61-
Machine: &ske.Machine{
62-
Image: &ske.Image{
63-
Name: utils.Ptr("name"),
64-
Version: utils.Ptr("3510.2.5"),
60+
AvailabilityZones: []string{"eu01-3"},
61+
Machine: ske.Machine{
62+
Image: ske.Image{
63+
Name: "name",
64+
Version: "3510.2.5",
6565
},
66-
Type: utils.Ptr("b1.2"),
66+
Type: "b1.2",
6767
},
68-
Maximum: utils.Ptr(int64(3)),
69-
Minimum: utils.Ptr(int64(2)),
70-
Name: utils.Ptr("my-nodepool"),
71-
Volume: &ske.Volume{
72-
Size: utils.Ptr(int64(20)),
68+
Maximum: int32(3),
69+
Minimum: int32(2),
70+
Name: "my-nodepool",
71+
Volume: ske.Volume{
72+
Size: int32(20),
7373
Type: utils.Ptr("storage_premium_perf0"),
7474
},
7575
},
7676
},
7777
}
7878
clusterName := "cl-name"
79-
createClusterResp, err := skeClient.CreateOrUpdateCluster(context.Background(), projectId, region, clusterName).CreateOrUpdateClusterPayload(createInstancePayload).Execute()
79+
createClusterResp, err := skeClient.DefaultAPI.CreateOrUpdateCluster(context.Background(), projectId, region, clusterName).CreateOrUpdateClusterPayload(createInstancePayload).Execute()
8080
if err != nil {
8181
fmt.Fprintf(os.Stderr, "Error when calling `CreateCluster`: %v\n", err)
8282
} else {
8383
fmt.Printf("Triggered creation of cluster with name \"%s\".\n", *createClusterResp.Name)
8484
}
8585

8686
// Wait for cluster creation to complete
87-
_, err = wait.CreateOrUpdateClusterWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background())
87+
_, err = wait.CreateOrUpdateClusterWaitHandler(context.Background(), skeClient.DefaultAPI, projectId, region, clusterName).WaitWithContext(context.Background())
8888
if err != nil {
8989
fmt.Fprintf(os.Stderr, "Error when calling `CreateOrUpdateCluster`: %v\n", err)
9090
} else {
9191
fmt.Printf("Cluster created.\n")
9292
}
9393

9494
// Start cluster credential rotation
95-
_, err = skeClient.StartCredentialsRotationExecute(context.Background(), projectId, region, clusterName)
95+
_, err = skeClient.DefaultAPI.StartCredentialsRotation(context.Background(), projectId, region, clusterName).Execute()
9696
if err != nil {
9797
fmt.Fprintf(os.Stderr, "Error when calling `StartCredentialsRotation`: %v\n", err)
9898
} else {
9999
fmt.Printf("Triggered start of cluster credentials rotation.\n")
100100
}
101101

102102
// Wait for cluster credential rotation to be prepared
103-
_, err = wait.StartCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background())
103+
_, err = wait.StartCredentialsRotationWaitHandler(context.Background(), skeClient.DefaultAPI, projectId, region, clusterName).WaitWithContext(context.Background())
104104
if err != nil {
105105
fmt.Fprintf(os.Stderr, "Error when calling `StartRotateCredentials`: %v\n", err)
106106
} else {
107107
fmt.Printf("Cluster credentials ready to rotate.\n")
108108
}
109109

110110
// Complete cluster credential rotation
111-
_, err = skeClient.CompleteCredentialsRotationExecute(context.Background(), projectId, region, clusterName)
111+
_, err = skeClient.DefaultAPI.CompleteCredentialsRotation(context.Background(), projectId, region, clusterName).Execute()
112112
if err != nil {
113113
fmt.Fprintf(os.Stderr, "Error when calling `CompleteCredentialsRotation`: %v\n", err)
114114
} else {
115115
fmt.Printf("Triggered completion of cluster credentials rotation.\n")
116116
}
117117

118118
// Wait for cluster credential rotation to be completed
119-
_, err = wait.CompleteCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background())
119+
_, err = wait.CompleteCredentialsRotationWaitHandler(context.Background(), skeClient.DefaultAPI, projectId, region, clusterName).WaitWithContext(context.Background())
120120
if err != nil {
121121
fmt.Fprintf(os.Stderr, "Error when calling `CompleteRotateCredentials`: %v\n", err)
122122
} else {

services/ske/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v1.8.0
2+
- **Feature:** Introduction of multi API version support for the ske SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
3+
- `v1api`: New package which can be used for communication with the ske v1 API
4+
- `v2api`: New package which can be used for communication with the ske v2 API
5+
- **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead.
6+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
7+
18
## v1.7.0
29
- **Feature:** new model `AccessScope`
310
- **Feature:** new model `V2ControlPlaneNetwork`

services/ske/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.7.0
1+
v1.8.0

0 commit comments

Comments
 (0)