oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
759 stars 675 forks source link

Change OKE app autoscaler config not working #2025

Open AndreyAgafonov opened 8 months ago

AndreyAgafonov commented 8 months ago

Terraform Version and Provider Version

Terraform v1.5.7
on darwin_arm64
+ provider registry.terraform.io/hashicorp/cloudinit v2.3.3
+ provider registry.terraform.io/hashicorp/random v3.5.1
+ provider registry.terraform.io/oracle/oci v5.22.0

Affected Resource(s)

oci_containerengine_addon.addons

Terraform Configuration Files

resource "oci_containerengine_addon" "addons" {
  depends_on = [module.nodegroups]
  #Required
  addon_name                 = "ClusterAutoscaler"
  cluster_id                       = oci_containerengine_cluster.containerengine_cluster.id
  remove_addon_resources_on_delete = true
  #Optional
  configurations {
    #Optional
    key   = "nodes"
    value = "1:2:ocid1.nodepool.oc1.<NodeGroup1>,1:5:ocid1.nodepool.oc1.<NodeGroup2>"
  }
}

For Example If i change NodeGroup2 node_max to 6

Expected Behavior

resource "oci_containerengine_addon" "addons" {
  configurations {
    #Optional
    key   = "nodes"
    value = "1:2:ocid1.nodepool.oc1.<NodeGroup1>,1:5:ocid1.nodepool.oc1.<NodeGroup2>" -> "1:2:ocid1.nodepool.oc1.<NodeGroup1>,1:6:ocid1.nodepool.oc1.<NodeGroup2>"
  }
}

Actual Behavior

No Changes

Steps to Reproduce

  1. Change max or min nodes in oci_containerengine_addon.addons in configurations
  2. Run terraform apply
Balaal commented 8 months ago

Came across the same issue. This is a bug / typo in the provider, where the DiffSuppressFunc used on the configurations attribute is checking old vs old when comparing the values in each entry, which explains why it lets me create the resource, but cannot modify unless the length of configuration options changes.

I have created a PR to fix this: https://github.com/oracle/terraform-provider-oci/pull/2027

tf-oci-pub commented 8 months ago

Thank you for reporting the issue. We observed the affected resources are not provided in the description or it's incorrect. We request you to add it in issue description as mentioned in below format. Example: affected_resources = oci_core_instance , oci_core_instances

If it's not related to any particular resource then mention affected resource as terraform. Example: affected_resources = terraform

As this works through automation, request you to follow exact syntax.