azurerm_kubernetes_cluster_node_pool - support for the pod_ip_allocation_mode property#30827
Conversation
azurerm_kubernetes_cluster_node_pool - support for the pod_ip_allocation_mode property
| return &out, nil | ||
| } | ||
|
|
||
| type ComputeType string |
There was a problem hiding this comment.
Please rebase to main branch, this field is updated by other commits.
| string(agentpools.PodIPAllocationModeDynamicIndividual), | ||
| string(agentpools.PodIPAllocationModeStaticBlock), | ||
| }, false), | ||
| Description: "Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'.", |
There was a problem hiding this comment.
Please use terraform attribute pod_subnet_id instead of podSubnetId in the description.
| Type: pluginsdk.TypeString, | ||
| Optional: true, | ||
| Default: string(agentpools.PodIPAllocationModeDynamicIndividual), | ||
| ValidateFunc: validation.StringInSlice([]string{ |
There was a problem hiding this comment.
Please change it to the helper function agentpools.PossibleValuesForPodIPAllocationMode()
| ) | ||
| } | ||
|
|
||
| func (KubernetesClusterNodePoolResource) podIPAllocationModeConfig(data acceptance.TestData) string { |
There was a problem hiding this comment.
Please combine the two configuration function and pass the allocation mode as an argument.
| } | ||
|
|
||
| resource "azurerm_kubernetes_cluster" "test" { | ||
| name = "acctestaks%d" |
There was a problem hiding this comment.
Please use %[1]d to format the string.
| Config: r.podIPAllocationModeConfigUpdated(data), | ||
| Check: acceptance.ComposeTestCheckFunc( | ||
| check.That(data.ResourceName).ExistsInAzure(r), | ||
| check.That(data.ResourceName).Key("pod_ip_allocation_mode").HasValue("DynamicIndividual"), |
There was a problem hiding this comment.
Please remove the checks on the properties.
|
Please also check if this property could be set in the kubernete cluster's default node pool. |
| "vm_size": vmSize, | ||
| "workload_runtime": workloadRunTime, | ||
| "pod_subnet_id": podSubnetId, | ||
| "pod_ip_allocation_mode": podIPAllocationMode, |
There was a problem hiding this comment.
Please use "pointer.From(agentPool.PodIPAllocationMode)" to simplify it.
|
|
||
| data.ResourceTest(t, r, []acceptance.TestStep{ | ||
| { | ||
| Config: r.defaultNodePoolPodIPAllocationMode(data, "StaticBlock"), |
There was a problem hiding this comment.
Please add steps to test it switch from one value to another.
| } | ||
|
|
||
| if props.PodIPAllocationMode != nil { | ||
| d.Set("pod_ip_allocation_mode", string(*props.PodIPAllocationMode)) |
There was a problem hiding this comment.
Please use pointer.From to simplify it.
|
Thanks @hqhqhqhqhqhqhqhqhqhqhq , LGTM! |
Community Note
Description
azurerm_kubernetes_cluster_node_pool- support for thepod_ip_allocation_modepropertyPR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_kubernetes_cluster_node_pool- support for thepod_ip_allocation_modepropertyThis is a (please select all that apply):
Related Issue(s)
Fixes #0000
AI Assistance Disclosure
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the provider.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Note
If this PR changes meaningfully during the course of review please update the title and description as required.