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

kubernetes_priority_class import incorrectly requires a namespace #680

Closed
tdmalone opened this issue Nov 11, 2019 · 3 comments · Fixed by #682
Closed

kubernetes_priority_class import incorrectly requires a namespace #680

tdmalone opened this issue Nov 11, 2019 · 3 comments · Fixed by #682

Comments

@tdmalone
Copy link
Contributor

tdmalone commented Nov 11, 2019

Terraform Version

Terraform v0.11.14
+ provider.aws v2.35.0
+ provider.kubernetes v1.10.0
+ provider.null v2.1.2

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "kubernetes_priority_class" "monitoring_critical" {
  metadata {
    name = "monitoring-critical"
  }

  value       = 1900000
  description = "Used for pods that are critical for monitoring workloads."
}

Expected Behavior

The existing PriorityClass should be imported.

Actual Behavior

The provider errored on import, requesting a namespace to be included:

$ terraform import kubernetes_priority_class.monitoring_critical monitoring-critical

kubernetes_priority_class.monitoring_critical: Importing from ID "monitoring-critical"...
kubernetes_priority_class.monitoring_critical: Import complete!
  Imported kubernetes_priority_class (ID: monitoring-critical)
kubernetes_priority_class.monitoring_critical: Refreshing state... (ID: monitoring-critical)

Error: kubernetes_priority_class.monitoring_critical (import id: monitoring-critical): 1 error occurred:
        * import kubernetes_priority_class.monitoring_critical result: monitoring-critical: kubernetes_priority_class.monitoring_critical: Unexpected ID format ("monitoring-critical"), expected "namespace/name".

Releasing state lock. This may take a few moments...

Steps to Reproduce

  1. Create a PriorityClass outside of Terraform
  2. Set up the configuration as above
  3. Run terraform import kubernetes_priority_class.monitoring_critical monitoring-critical
  4. Observe error

Important Factoids

@lawliet89
Copy link
Contributor

Try running it with default/<name>. It's a bit strange but probably something missed out during the implementation.

@tdmalone
Copy link
Contributor Author

I tried that too - mentioned above under the Important Factoids - which resulted in an error saying the resource didn't exist (which makes sense).

@alexsomesan
Copy link
Member

I've opened a PR to address this.

@ghost ghost locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants