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

Container cluster importable #391

Merged
merged 11 commits into from
Sep 7, 2017
Merged

Container cluster importable #391

merged 11 commits into from
Sep 7, 2017

Conversation

drzero42
Copy link
Contributor

@drzero42 drzero42 commented Sep 6, 2017

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?

@rosbo rosbo self-requested a review September 6, 2017 22:03
Copy link
Contributor

@rosbo rosbo left a 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) {
Copy link
Contributor

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).

Copy link
Contributor Author

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 :)

@rosbo
Copy link
Contributor

rosbo commented Sep 7, 2017

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

@rosbo rosbo merged commit 67b7b2d into hashicorp:master Sep 7, 2017
@drzero42 drzero42 deleted the container_cluster_importable branch September 7, 2017 18:05
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
Signed-off-by: Modular Magician <magic-modules@google.com>
@ghost
Copy link

ghost commented Mar 31, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 31, 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 this pull request may close these issues.

Add import functionality for GKE cluster and nodepools
3 participants