Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_kubernetes_cluster: provider wants to destroy/recreate cluster due to case mismatch in network_plugin_mode #22621

Closed
1 task done
jeffhuenemann opened this issue Jul 20, 2023 · 3 comments

Comments

@jeffhuenemann
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.5.3

AzureRM Provider Version

3.65.0

Affected Resource(s)/Data Source(s)

azurerm_kubernetes_cluster

Terraform Configuration Files

resource "azurerm_kubernetes_cluster" "aks1" {
# ...
  network_profile {
    network_plugin      = "azure"
    network_plugin_mode = "Overlay"
  }
}

Debug Output/Panic Output

# module.kubernetes_cluster_standard.azurerm_kubernetes_cluster.aks1 must be replaced
-/+ resource "azurerm_kubernetes_cluster" "aks1" {
#[snip]
      ~ network_profile {
#[snip]
          + network_mode        = (known after apply)
          ~ network_plugin_mode = "overlay" -> "Overlay" # forces replacement
        }
    }

Expected Behaviour

Per the azurerm_kubernetes_cluster docs, the acceptable value of network_plugin_mode is Overlay (uppercase O). With that value in play, subsequent plans/applies without any code change should not represent a mismatch of value, and should not suggest recreating the cluster.

Actual Behaviour

In the state file, the state is represented with a lowercase o, creating a mismatch with uppercase O required in the configuration. terraform plan wants to replace the entire cluster due to network_plugin_mode changing (it thinks) from overlay in state to Overlay in configuration.

Steps to Reproduce

  1. Create an azurerm_kubernetes_cluster using network_plugin = azure and network_plugin_mode = Overlay
  2. Subsequent terraform plan suggests to recreate the cluster on account of drift innetwork_plugin_mode

Important Factoids

Did not observe this behavior until upgrading from 3.63 to 3.65

References

No response

@github-actions github-actions bot added the v/3.x label Jul 20, 2023
@jeffhuenemann
Copy link
Author

Improved search on my part reveals #22151 -> #22153 for an update to the API version in use, so maybe this is really just a documentation change and overlay is the only appropriate input value? If the provider accepts both overlay and Overlay as inputs, then they both need to be non-impactful on subsequent plans/applies, to my thinking.

@stephybun
Copy link
Member

Thanks for raising this issue @jeffhuenemann.

The resource will allow the value to be lowercased to overlay without replacing the cluster - this is unfortunately an update that needs to be done in the user's config since this change was shipped by the upstream API.

The latest release v3.66.0 shipped a documentation fix to the casing of the value in #22554.

Since this is working as expected and the documentation has been fixed I'm going to close this issue.

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants