Skip to content

Commit

Permalink
fix internal validate errors caused by 4.0 changes (#25355)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephybun authored Mar 21, 2024
1 parent 7113acd commit 7147248
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,15 @@ func resourceKubernetesClusterNodePoolSchema() map[string]*pluginsdk.Schema {
},

"node_public_ip_prefix_id": {
Type: pluginsdk.TypeString,
Optional: true,
ForceNew: true,
RequiredWith: []string{"enable_node_public_ip"},
Type: pluginsdk.TypeString,
Optional: true,
ForceNew: true,
RequiredWith: func() []string {
if !features.FourPointOhBeta() {
return []string{"enable_node_public_ip"}
}
return []string{"node_public_ip_enabled"}
}(),
},

// Node Taints control the behaviour of the Node Pool, as such they should not be computed and
Expand Down
7 changes: 6 additions & 1 deletion internal/services/containers/kubernetes_nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ func SchemaDefaultNodePool() *pluginsdk.Schema {
Optional: true,
ForceNew: true,
ValidateFunc: networkValidate.PublicIpPrefixID,
RequiredWith: []string{"default_node_pool.0.enable_node_public_ip"},
RequiredWith: func() []string {
if !features.FourPointOhBeta() {
return []string{"default_node_pool.0.enable_node_public_ip"}
}
return []string{"default_node_pool.0.node_public_ip_enabled"}
}(),
},

"node_taints": {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/network/subnet_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func resourceSubnet() *pluginsdk.Resource {
return !features.FourPointOh()
}(),
ConflictsWith: func() []string {
if !features.FourPointOh() {
if !features.FourPointOhBeta() {
return []string{"enforce_private_link_endpoint_network_policies"}
}
return []string{}
Expand Down

0 comments on commit 7147248

Please sign in to comment.