-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 - private_cluster_public_fqdn_enabled is no longer force new #13413
Conversation
Fix hashicorp#13099, to do in place update for `private_cluster_public_fqdn_enabled`
would be good if someone can fast-track the review and get it in the next release as it is impacting customers with private clusters who need to upgrade to azurerm ~>= 2.73 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hieumoscow It looks good to me besides the comment, but I'm not a maintainer tbh. I'll run the specific AccTest now to check if it is indeed working, will let you know.
Edit: Test is failing, see below
❯ make acctests SERVICE='containers' TESTARGS='-run=TestAccKubernetesCluster_privateClusterPublicFqdn'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/containers -run=TestAccKubernetesCluster_privateClusterPublicFqdn -timeout 180m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN TestAccKubernetesCluster_privateClusterPublicFqdn
=== PAUSE TestAccKubernetesCluster_privateClusterPublicFqdn
=== CONT TestAccKubernetesCluster_privateClusterPublicFqdn
testcase.go:88: Step 3/4 error: After applying this test step, the plan was not empty.
stdout:
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# azurerm_kubernetes_cluster.test will be updated in-place
~ resource "azurerm_kubernetes_cluster" "test" {
id = "/subscriptions/<mysubscription>/resourcegroups/acctestRG-aks-210920150634755905/providers/Microsoft.ContainerService/managedClusters/acctestaks210920150634755905"
name = "acctestaks210920150634755905"
~ private_cluster_public_fqdn_enabled = false -> true
tags = {}
# (16 unchanged attributes hidden)
# (6 unchanged blocks hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccKubernetesCluster_privateClusterPublicFqdn (925.56s)
FAIL
FAIL github.com/hashicorp/terraform-provider-azurerm/internal/services/containers 927.181s
FAIL
make: *** [acctests] Error 1
It seems EnablePrivateClusterPublicFQDN
is not updated/set in resourceKubernetesClusterUpdate
, you should add it there somehow to make this work.
By adding below the test was passing, maybe that is enough to enable this functionality:
diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go
index 50534ab81..517fff0e7 100644
--- a/internal/services/containers/kubernetes_cluster_resource.go
+++ b/internal/services/containers/kubernetes_cluster_resource.go
@@ -1224,6 +1224,11 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{}
}
}
+ if d.HasChange("private_cluster_public_fqdn_enabled") {
+ updateCluster = true
+ existing.ManagedClusterProperties.APIServerAccessProfile.EnablePrivateClusterPublicFQDN = utils.Bool(d.Get("private_cluster_public_fqdn_enabled").(bool))
+ }
+
if d.HasChange("auto_scaler_profile") {
updateCluster = true
autoScalerProfileRaw := d.Get("auto_scaler_profile").([]interface{})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change @hieumoscow - could we update the docs to reflect this change and add/update/fix the update test so it passes to ensure this continues to work? thanks!
@katbyte I have updated per @aristosvo suggestion, I do not think we need to update the doc as there was no "Changing this forces a new resource to be created." phrase there before. |
Ran the test locally, all passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hieumoscow! LGTM now 🏗️
This functionality has been released in v2.78.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fix #13099, to do in place update for
private_cluster_public_fqdn_enabled