terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
Unable to show resources with self_link in metadata
Terraform Version, Provider Version and Kubernetes Version
Terraform version: v0.15.3
Kubernetes provider version: v2.3.1
Affected Resource(s)
kubernetes_config_mapkubernetes_namespace- Almost certainly others as well
Terraform Configuration Files
resource "kubernetes_config_map" "example" {
metadata {
name = "my-config"
}
}
Debug Output
Panic Output
Steps to Reproduce
- Create a
kubernetes_config_mapwith v2.3.0 (or earlier) of the Kubernetes provider - Run
terraform state show kubernetes_config_map.exampleto verify it works - Upgrade the Kubernetes provider to v2.3.1
terraform state show kubernetes_config_map.examplewill no longer work withunsupported attribute "self_link"error message
Expected Behavior
The resource should have been output.
Actual Behavior
unsupported attribute "self_link" error message
Important Factoids
This also causes errors if you try to open terraform console in any affected directories.
References
It appears to stem from https://github.com/hashicorp/terraform-provider-kubernetes/pull/1294 cc @dak1n1
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Unrelated but FYI I was just notified issue_triage failed with
Error: Unable to resolve action `github/issue-labeler@v2`, unable to find version `v2`
Looks like we need a StateUpgrader to delete the self_link attribute from state for it to work with the terraform state command. I was able to reproduce and this doesn't seem to be affecting plan or apply.
A workaround here is run terraform refresh which will fix the state.
Unrelated but FYI I was just notified issue_triage failed with
Error: Unable to resolve action `github/issue-labeler@v2`, unable to find version `v2`
Thanks for letting us know! I added some fixes to my Github Workflow PR that's in progress here: https://github.com/hashicorp/terraform-provider-kubernetes/pull/1300
✗ tfp
╷
│ Error: Unsupported attribute
│
│ on ../../modules/cluster_vault/kms.tf line 17, in resource "google_kms_crypto_key" "vault_init":
│ 17: key_ring = google_kms_key_ring.vault.self_link
│
│ This object has no argument, nested block, or exported attribute named "self_link".
Ive already tried tf refresh but no use.
Any idea how I can fix this ?
tf version
Terraform v1.0.10
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.0.0
+ provider registry.terraform.io/hashicorp/google-beta v4.0.0
Ok so i got hold of https://github.com/hashicorp/terraform-provider-google/pull/10424/files !
Found the fix. Replaced self_link with id in the code
Any solution for this? I'm getting this error after upgrading from 2.0.0 to 2.78:
| Error decoding "module.az-devops-namespace_setup.kubernetes_secret.pull_secret[0]" from previous state:
│ unsupported attribute "self_link"
@MeNsaaH similar issue here, version 2.11.0. Were you able to resolve it?
@tobamaestro no. I had to downgrade
@MeNsaaH Thanks for quick reply! Did you try running terraform refresh maybe before downgrading?
@tobamaestro I'm not sure I did. I think I deleted my lock file, ran init then destroyed
I encountered this issue, refreshing didn't help. I resolved it using terraform state rm to delete the offending resources, and then I re-imported them. Because I imported them using the latest Kubernetes provider version, it fixed the bad attributes.
Happening with me on version 2.13.0.
Terraform will perform the following actions:
# module.nexus_admin_user_password.kubernetes_secret.user_password will be updated in-place
~ resource "kubernetes_secret" "user_password" {
~ data = (sensitive value)
id = "studio-ci/nexus-admin"
# (2 unchanged attributes hidden)
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!