Skip to content

Commit ae6ef6d

Browse files
committed
containers: allow Ubuntu2404 for AKS os_sku
Changes: - allow `Ubuntu2404` in the AKS node pool `os_sku` schema validation list - allow `Ubuntu2404` in the AKS default node pool `os_sku` schema validation list - add offline schema tests that lock in `Ubuntu2404` acceptance for both code paths Validation: - go test ./internal/services/containers -run "TestKubernetes.*Ubuntu2404" -count=1
1 parent 26088b3 commit ae6ef6d

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

internal/services/containers/kubernetes_cluster_node_pool_resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ func resourceKubernetesClusterNodePoolSchema() map[string]*pluginsdk.Schema {
333333
string(agentpools.OSSKUAzureLinuxThree),
334334
string(agentpools.OSSKUUbuntu),
335335
string(agentpools.OSSKUUbuntuTwoTwoZeroFour),
336+
string(agentpools.OSSKUUbuntuTwoFourZeroFour),
336337
string(agentpools.OSSKUWindowsTwoZeroOneNine),
337338
string(agentpools.OSSKUWindowsTwoZeroTwoTwo),
338339
}, false),

internal/services/containers/kubernetes_nodepool.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ func SchemaDefaultNodePool() *pluginsdk.Schema {
191191
string(agentpools.OSSKUAzureLinuxThree),
192192
string(agentpools.OSSKUUbuntu),
193193
string(agentpools.OSSKUUbuntuTwoTwoZeroFour),
194+
string(agentpools.OSSKUUbuntuTwoFourZeroFour),
194195
string(agentpools.OSSKUWindowsTwoZeroOneNine),
195196
string(agentpools.OSSKUWindowsTwoZeroTwoTwo),
196197
}, false),
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright IBM Corp. 2014, 2025
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package containers
5+
6+
import (
7+
"testing"
8+
9+
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
10+
)
11+
12+
func TestKubernetesClusterNodePoolSchemaAcceptsUbuntu2404(t *testing.T) {
13+
validate := resourceKubernetesClusterNodePoolSchema()["os_sku"].ValidateFunc
14+
if validate == nil {
15+
t.Fatal("node pool os_sku ValidateFunc is nil")
16+
}
17+
18+
if warnings, errs := validate("Ubuntu2404", "os_sku"); len(warnings) != 0 || len(errs) != 0 {
19+
t.Fatalf("expected Ubuntu2404 to be accepted for node pool os_sku, got warnings=%v errs=%v", warnings, errs)
20+
}
21+
}
22+
23+
func TestKubernetesClusterDefaultNodePoolSchemaAcceptsUbuntu2404(t *testing.T) {
24+
defaultNodePool := resourceKubernetesCluster().Schema["default_node_pool"]
25+
if defaultNodePool == nil {
26+
t.Fatal("default_node_pool schema is nil")
27+
}
28+
29+
defaultNodePoolResource, ok := defaultNodePool.Elem.(*pluginsdk.Resource)
30+
if !ok {
31+
t.Fatalf("expected default_node_pool elem to be a resource, got %T", defaultNodePool.Elem)
32+
}
33+
34+
validate := defaultNodePoolResource.Schema["os_sku"].ValidateFunc
35+
if validate == nil {
36+
t.Fatal("default node pool os_sku ValidateFunc is nil")
37+
}
38+
39+
if warnings, errs := validate("Ubuntu2404", "os_sku"); len(warnings) != 0 || len(errs) != 0 {
40+
t.Fatalf("expected Ubuntu2404 to be accepted for default node pool os_sku, got warnings=%v errs=%v", warnings, errs)
41+
}
42+
}

0 commit comments

Comments
 (0)