Terraform-provider-kubernetes: Unable to show resources with self_link in metadata

Created on 8 Jun 2021  路  3Comments  路  Source: hashicorp/terraform-provider-kubernetes

Terraform Version, Provider Version and Kubernetes Version

Terraform version: v0.15.3
Kubernetes provider version: v2.3.1

Affected Resource(s)

  • kubernetes_config_map
  • kubernetes_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_map with v2.3.0 (or earlier) of the Kubernetes provider
  • Run terraform state show kubernetes_config_map.example to verify it works
  • Upgrade the Kubernetes provider to v2.3.1
  • terraform state show kubernetes_config_map.example will no longer work with unsupported 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
    bug

    Most helpful comment

    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.

    All 3 comments

    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

    Was this page helpful?
    0 / 5 - 0 ratings