Skip to content

Commit adeb5cf

Browse files
authored
update go to 1.26.1 (#141)
1 parent 10d7ef2 commit adeb5cf

File tree

12 files changed

+43
-45
lines changed

12 files changed

+43
-45
lines changed

.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ linters:
2020
- importas
2121
- ineffassign
2222
- misspell
23+
- modernize
2324
- nakedret
2425
- noctx
2526
- nolintlint

docs/machine-class.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ A MachineClass defines how STACKIT servers should be created. The ProviderSpec i
1515

1616
## ProviderSpec Fields
1717

18-
| Field | Type | Required | Description |
19-
| --------------------- | ---------------------- | -------- | ------------------------------------------------------------- |
20-
| `region` | string | Yes | STACKIT region (e.g., "eu01", "eu02"). |
21-
| `machineType` | string | Yes | STACKIT server type (e.g., "c2i.2", "m2i.8"). |
22-
| `imageId` | string | Yes\* | Image UUID. Required unless `bootVolume.source` is specified. |
23-
| `labels` | map[string]string | No | Labels for server identification. |
24-
| `networking` | NetworkingSpec | Yes | Network configuration (either `networkId` or `nicIds`). |
25-
| `allowedAddresses` | []string | No | CIDR ranges allowed for anti-spoofing bypass. |
26-
| `securityGroups` | []string | No | Security group UUIDs. |
27-
| `userData` | string | No | Cloud-init user data (overrides Secret.userData). |
28-
| `bootVolume` | BootVolumeSpec | No | Boot disk configuration. |
29-
| `volumes` | []string | No | UUIDs of existing volumes to attach. |
30-
| `keypairName` | string | No | SSH keypair name. |
31-
| `availabilityZone` | string | No | Availability zone (e.g., "eu01-1"). |
32-
| `affinityGroup` | string | No | UUID of affinity group. |
33-
| `serviceAccountMails` | []string | No | Service account emails (max 1). |
34-
| `agent` | AgentSpec | No | STACKIT agent configuration. |
35-
| `metadata` | map[string]interface{} | No | Freeform metadata. |
18+
| Field | Type | Required | Description |
19+
| --------------------- | ----------------- | -------- | ------------------------------------------------------------- |
20+
| `region` | string | Yes | STACKIT region (e.g., "eu01", "eu02"). |
21+
| `machineType` | string | Yes | STACKIT server type (e.g., "c2i.2", "m2i.8"). |
22+
| `imageId` | string | Yes\* | Image UUID. Required unless `bootVolume.source` is specified. |
23+
| `labels` | map[string]string | No | Labels for server identification. |
24+
| `networking` | NetworkingSpec | Yes | Network configuration (either `networkId` or `nicIds`). |
25+
| `allowedAddresses` | []string | No | CIDR ranges allowed for anti-spoofing bypass. |
26+
| `securityGroups` | []string | No | Security group UUIDs. |
27+
| `userData` | string | No | Cloud-init user data (overrides Secret.userData). |
28+
| `bootVolume` | BootVolumeSpec | No | Boot disk configuration. |
29+
| `volumes` | []string | No | UUIDs of existing volumes to attach. |
30+
| `keypairName` | string | No | SSH keypair name. |
31+
| `availabilityZone` | string | No | Availability zone (e.g., "eu01-1"). |
32+
| `affinityGroup` | string | No | UUID of affinity group. |
33+
| `serviceAccountMails` | []string | No | Service account emails (max 1). |
34+
| `agent` | AgentSpec | No | STACKIT agent configuration. |
35+
| `metadata` | map[string]any | No | Freeform metadata. |
3636

3737
## NetworkingSpec
3838

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/stackitcloud/machine-controller-manager-provider-stackit
22

3-
go 1.25.0
3+
go 1.26.1
44

55
require (
66
github.com/gardener/machine-controller-manager v0.61.2

pkg/client/helper.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
package client
22

3-
// convertLabelsToSDK converts map[string]string to *map[string]interface{} for SDK
4-
func convertLabelsToSDK(labels map[string]string) map[string]interface{} {
3+
// convertLabelsToSDK converts map[string]string to *map[string]any for SDK
4+
func convertLabelsToSDK(labels map[string]string) map[string]any {
55
if labels == nil {
66
return nil
77
}
88

9-
result := make(map[string]interface{}, len(labels))
9+
result := make(map[string]any, len(labels))
1010
for k, v := range labels {
1111
result[k] = v
1212
}
1313
return result
1414
}
1515

16-
// convertLabelsFromSDK converts *map[string]interface{} from SDK to map[string]string
16+
// convertLabelsFromSDK converts *map[string]any from SDK to map[string]string
1717
//
1818
//nolint:gocritic // SDK requires *map
19-
func convertLabelsFromSDK(labels *map[string]interface{}) map[string]string {
19+
func convertLabelsFromSDK(labels *map[string]any) map[string]string {
2020
if labels == nil {
2121
return nil
2222
}

pkg/client/sdk_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ var _ = Describe("SDK Type Conversion Helpers", func() {
139139
Describe("convertLabelsFromSDK", func() {
140140
Context("with valid SDK labels", func() {
141141
It("should convert SDK labels to string map", func() {
142-
sdkLabels := map[string]interface{}{
142+
sdkLabels := map[string]any{
143143
"app": "web-server",
144144
"team": "platform",
145145
}
@@ -153,7 +153,7 @@ var _ = Describe("SDK Type Conversion Helpers", func() {
153153
})
154154

155155
It("should convert empty SDK labels map", func() {
156-
sdkLabels := map[string]interface{}{}
156+
sdkLabels := map[string]any{}
157157

158158
result := convertLabelsFromSDK(&sdkLabels)
159159

@@ -162,7 +162,7 @@ var _ = Describe("SDK Type Conversion Helpers", func() {
162162
})
163163

164164
It("should skip non-string values", func() {
165-
sdkLabels := map[string]interface{}{
165+
sdkLabels := map[string]any{
166166
"app": "web-server",
167167
"count": 42, // not a string
168168
"enabled": true, // not a string
@@ -180,7 +180,7 @@ var _ = Describe("SDK Type Conversion Helpers", func() {
180180
})
181181

182182
It("should handle nil values in map", func() {
183-
sdkLabels := map[string]interface{}{
183+
sdkLabels := map[string]any{
184184
"app": "web-server",
185185
"team": nil,
186186
}

pkg/client/stackit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type CreateServerRequest struct {
4545
AffinityGroup string `json:"affinityGroup,omitempty"`
4646
ServiceAccountMails []string `json:"serviceAccountMails,omitempty"`
4747
Agent *AgentRequest `json:"agent,omitempty"`
48-
Metadata map[string]interface{} `json:"metadata,omitempty"`
48+
Metadata map[string]any `json:"metadata,omitempty"`
4949
}
5050

5151
// ServerNetworkingRequest represents the networking configuration for a server

pkg/provider/apis/provider_spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type ProviderSpec struct {
8080
// Metadata is a generic JSON object for storing arbitrary key-value pairs
8181
// Optional field. Can be used to store custom metadata that doesn't fit into other fields
8282
// Example: {"environment": "production", "cost-center": "12345"}
83-
Metadata map[string]interface{} `json:"metadata,omitempty"`
83+
Metadata map[string]any `json:"metadata,omitempty"`
8484
}
8585

8686
// AgentSpec defines the STACKIT agent configuration for a server

pkg/provider/apis/validation/validation_fields_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,13 @@ var _ = Describe("ValidateProviderSpecNSecret", func() {
251251
})
252252

253253
It("should succeed with empty metadata", func() {
254-
providerSpec.Metadata = map[string]interface{}{}
254+
providerSpec.Metadata = map[string]any{}
255255
errors := ValidateProviderSpecNSecret(providerSpec, secret)
256256
Expect(errors).To(BeEmpty())
257257
})
258258

259259
It("should succeed with valid metadata", func() {
260-
providerSpec.Metadata = map[string]interface{}{
260+
providerSpec.Metadata = map[string]any{
261261
"environment": "production",
262262
"cost-center": "12345",
263263
"owner": "team-a",
@@ -267,8 +267,8 @@ var _ = Describe("ValidateProviderSpecNSecret", func() {
267267
})
268268

269269
It("should succeed with nested metadata objects", func() {
270-
providerSpec.Metadata = map[string]interface{}{
271-
"tags": map[string]interface{}{
270+
providerSpec.Metadata = map[string]any{
271+
"tags": map[string]any{
272272
"env": "prod",
273273
"tier": "backend",
274274
},

pkg/provider/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func (p *Provider) createServerRequest(req *driver.CreateMachineRequest, provide
159159
// DeleteOnTermination defaults to false in the IaaS API
160160
// unless explicitly disabled, bootVolumes should always be cleaned up automatically
161161
// otherwise this produces many orphaned volumes since node rolls happen frequently in k8s
162-
DeleteOnTermination: ptr.To(ptr.Deref(providerSpec.BootVolume.DeleteOnTermination, true)),
162+
DeleteOnTermination: new(ptr.Deref(providerSpec.BootVolume.DeleteOnTermination, true)),
163163
PerformanceClass: providerSpec.BootVolume.PerformanceClass,
164164
Size: providerSpec.BootVolume.Size,
165165
}

pkg/provider/create_config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ var _ = Describe("CreateMachine", func() {
339339
NetworkID: "770e8400-e29b-41d4-a716-446655440000",
340340
},
341341
ImageID: "12345678-1234-1234-1234-123456789abc",
342-
Metadata: map[string]interface{}{
342+
Metadata: map[string]any{
343343
"environment": "production",
344344
"cost-center": "12345",
345345
"count": 42,

0 commit comments

Comments
 (0)