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

When applying changes to juju_kubernetes_cloud, provider provider["registry.terraform.io/juju/juju"] produced an unexpected new value: .kubernetes_config: inconsistent values for sensitive attribute. #664

Open
mcarvalhor opened this issue Feb 4, 2025 · 1 comment · May be fixed by #665
Labels
kind/bug indicates a bug in the project

Comments

@mcarvalhor
Copy link

Description

We're getting this error when using resource juju_kubernetes_cloud.

This is the plan:

  # juju_kubernetes_cloud.cluster_k8s_cloud will be updated in-place
  ~ resource "juju_kubernetes_cloud" "cluster_k8s_cloud" {
        id                = "k8s-stg-is-iam:k8s-stg-is-iam"
      ~ kubernetes_config = (sensitive value)
        name              = "k8s-stg-is-iam"
        # (1 unchanged attribute hidden)
    }

This is the error message:

juju_kubernetes_cloud.cluster_k8s_cloud: Modifying... [id=k8s-stg-is-iam:k8s-stg-is-iam]
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to juju_kubernetes_cloud.cluster_k8s_cloud, provider "provider[\"registry.terraform.io/juju/juju\"]" produced an unexpected new value: .kubernetes_config:
│ inconsistent values for sensitive attribute.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

The value for "kubernetes_config" has changed, but looks like we can't change it for the cloud.

Urgency

Annoying bug in our test suite

Terraform Juju Provider version

v0.15.1

Terraform version

v1.10.5-dev

Juju version

v3.6.1

Terraform Configuration(s)

data "vault_generic_secret" "kubeconfig" {
#  depends_on = [
#    module.canonical_k8s
#  ]
  path = "secret/prodstack6/managed/kubernetes/k8s-stg-is-iam"
}

resource "juju_kubernetes_cloud" "cluster_k8s_cloud" {
  name              = "k8s-stg-is-iam"
  kubernetes_config = base64decode(data.vault_generic_secret.kubeconfig.data["kubeconfig_b64"])
}

Reproduce / Test

terraform init && terraform apply

Debug/Panic Output

`terraform apply` output:
- https://pastebin.canonical.com/p/85WkTk7pFv/

Terraform Trace Logs:
- https://private-fileshare.canonical.com/~mcarvalhor/2025-02-04_terraform-provider-kubernetes_config-inconsistent-values-for-sensitive-attribute/.t7o3Emcakka3nMzBc/trace.log

Notes & References

No response

@mcarvalhor mcarvalhor added kind/bug indicates a bug in the project state/untriaged untriaged bug report labels Feb 4, 2025
SimoneDutto added a commit to SimoneDutto/terraform-provider-juju that referenced this issue Feb 5, 2025
Before we were getting the plan from the req.State, so changes were not propagated in the state.

fix juju#664
@SimoneDutto
Copy link
Contributor

Hi @mcarvalhor, thank you for reporting the issue.
I've managed to reproduce the bug you've filed locally and I am working on a fix, I'll update you as soon as I have any news.

@SimoneDutto SimoneDutto removed the state/untriaged untriaged bug report label Feb 5, 2025
SimoneDutto added a commit to SimoneDutto/terraform-provider-juju that referenced this issue Feb 10, 2025
Before we were getting the plan from the req.State, so changes were not propagated in the state.

fix juju#664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug indicates a bug in the project
Projects
None yet
2 participants