-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Container cluster importable #391
Container cluster importable #391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just a little problem with the id format.
@@ -742,3 +747,15 @@ func generateNodePoolName(prefix string, d *schema.ResourceData) (string, error) | |||
return resource.UniqueId(), nil | |||
} | |||
} | |||
|
|||
func resourceContainerClusterStateImporter(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test test is failling:
--- FAIL: TestAccGoogleContainerCluster_import (275.85s)
testing.go:428: Step 1 error: Resource specified by ResourceName couldn't be found: google_container_cluster.np
The ID should be set to the name only
. See the create method above (line 474).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh.. Should be fixed now :)
I fixed the import acceptance test and pushed the change to your branch to be able to merge this quickly. TF_ACC=1 go test ./google -v -run TestAccGoogleContainerCluster_import -timeout 120m
=== RUN TestAccGoogleContainerCluster_import
--- PASS: TestAccGoogleContainerCluster_import (266.89s)
PASS
ok github.com/terraform-providers/terraform-provider-google/google 267.016s |
Signed-off-by: Modular Magician <magic-modules@google.com>
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Fixes #165
I had to change resourceContainerClusterRead to use container.Network rather than d.Get("network"), otherwise it would set network = "" during import. Not sure why network was set this way before?