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

tanzu-mission-control_helm_feature Terraform Apply Update Failure #493

Open
1 of 4 tasks
stevewallone opened this issue Jan 18, 2025 · 1 comment
Open
1 of 4 tasks
Labels
bug Bug needs-triage Needs Triage pending-review Pending Review

Comments

@stevewallone
Copy link

Code of Conduct

  • I have read and agree to the Code of Conduct.
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

1.10.4

Terraform Provider

1.4.7

Description

The tanzu-mission-control_helm_feature resource is created as part of a larger terraform module structure. Executing terraform apply after the creation of tanzu-mission-control_helm_feature causes a terraform failure. Based on a debug message, I believe the failure is due to a change in the .status["phase"] value. The stored state has Enabling, but the reported state is Enabled.

Terraform will perform the following actions:

  # module.cluster_module.tanzu-mission-control_helm_feature.cluster_helm_feature will be updated in-place
  ~ resource "tanzu-mission-control_helm_feature" "cluster_helm_feature" {
        id     = "c:01JHRK0WPJ8GGEPS1X28VXQBQ6"
        # (1 unchanged attribute hidden)

      ~ meta {
          + description      = "Enable Helm feature for the cluster"
            # (4 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
module.cluster_module.tanzu-mission-control_helm_feature.cluster_helm_feature: Modifying... [id=c:01JHRK0WPJ8GGEPS1X28VXQBQ6]
╷
│ Error: doesn't support update
│
│   with module.cluster_module.tanzu-mission-control_helm_feature.cluster_helm_feature,
│   on .terraform/modules/cluster_module/tmc.tf line 179, in resource "tanzu-mission-control_helm_feature" "cluster_helm_feature":
│  179: resource "tanzu-mission-control_helm_feature" "cluster_helm_feature" {
│
╵

DEBUG MESSAGE

2025-01-17T16:46:10.161-0700 [WARN]  Provider "registry.terraform.io/vmware/tanzu-mission-control" produced an unexpected new value for module.cluster_module.tanzu-mission-control_helm_feature.cluster_helm_feature during refresh.
      - .status["phase"]: was cty.StringVal("Enabling"), but now cty.StringVal("Enabled")
      - .meta[0].resource_version: was cty.StringVal("11"), but now cty.StringVal("13")

Affected Resources or Data Sources

resource/tanzu-mission-control_helm_feature

Terraform Configuration

resource "tanzu-mission-control_helm_feature" "cluster_helm_feature" {
  depends_on = [tanzu-mission-control_tanzu_kubernetes_cluster.tkgm_cluster]
  scope {
    cluster {
      name                    = var.cluster
      provisioner_name        = var.provisioner
      management_cluster_name = var.management_cluster
    }
  }

  meta {
    description = "Enable Helm feature for the cluster"
  }
}

Debug Output

https://gist.github.com/stevewallone/b3ce635b7585cbd4fde5c71223fdb5ee

Panic Output

No response

Expected Behavior

The terraform apply should see the resource as unchanged.

Actual Behavior

terraform apply detects a change to the resource.

Steps to Reproduce

  • Run terraform apply to create the resource.
  • Run terraform apply again.

Environment Details

No response

Screenshots

No response

References

No response

@stevewallone stevewallone added bug Bug needs-triage Needs Triage labels Jan 18, 2025
@github-actions github-actions bot added the pending-review Pending Review label Jan 18, 2025
@stevewallone
Copy link
Author

stevewallone commented Jan 19, 2025

Figured out a work around by ignoring changes to the attributes. Just ignoring the phase for status was sufficient, but meta had more changes, so I just ignored the entire list. Maybe this could just be a documentation change?

#  Tanzu Mission Control cluster scope helm feature.
resource "tanzu-mission-control_helm_feature" "cluster_helm_feature" {
  depends_on = [tanzu-mission-control_tanzu_kubernetes_cluster.tkgm_cluster]
  scope {
    cluster {
      name                    = var.cluster
      provisioner_name        = var.provisioner
      management_cluster_name = var.management_cluster
    }
  }

  meta {
    description = "Enable Helm feature for the cluster"
  }

  # Ignore changes to the status.phase and meta fields. This was causing an error after
  # the helm feature was created. It does not support an update, and these attributes
  # were getting different values. Status changed from "Enabling" to "Enabled" and meta
  # had several changes. These changes are not relevant to the feature itself being enable.
  lifecycle {
    ignore_changes = [
      status["phase"],
      meta,
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug needs-triage Needs Triage pending-review Pending Review
Projects
None yet
Development

No branches or pull requests

1 participant