Closed santhoshbhandari3008 closed 5 months ago
Hi @santhoshbhandari3008, thank you for the issue.
The field vmSize
is immutable: Changing this forces a new resource to be created
.
Changing this field will cause the resource to be deleted and created again, according to the Crossplane Resource Model, this is something we do not allow.
Similar: https://github.com/crossplane-contrib/provider-upjet-aws/issues/1061#issuecomment-1880979041
Since this is to be expected, I am closing this issue. Upstream issue with rejecting change requests for immutable fields.
Makes sense
What problem are you facing?
I am unable to change the nodepool size, as it shows the below error, managed/containerservice.azure.upbound.io/v1beta1, kind=kubernetesclusternodepool cannot run plan: plan failed: Instance cannot be destroyed: Resource azurerm_kubernetes_cluster_node_pool.* has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or reduce the scope of the plan using the -target flag.
The first time deployment file,
Revised deployment file,
This creates nodepool with the size Standard_DS2_v2. When i try to change the vmSize to any other, it throws error,
managed/containerservice.azure.upbound.io/v1beta1, kind=kubernetesclusternodepool cannot run plan: plan failed: Instance cannot be destroyed: Resource azurerm_kubernetes_cluster_node_pool.example has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or reduce the scope of the plan using the -target flag.
Expected Output
The nodepool created successfully.
How could Official Azure Provider help solve your problem?
I checked the source code from the repository, it misses the prevent_destroy option to declare.