-
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
Add wait_for_instances field to IGM and self_link option to the IG data source #1222
Conversation
Timeout: d.Timeout(schema.TimeoutCreate), | ||
} | ||
_, err := conf.WaitForState() | ||
// If err is nil, success. |
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.
If someone later adds some code below this, it'll get missed - might be good to add a comment saying not to do that? Not sure.
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.
Just updated it to return the error only if there is one, that seemed like a much more standard way to go about this.
@@ -257,17 +257,17 @@ func waitForInstancesRefreshFunc(f getInstanceManagerFunc, d *schema.ResourceDat | |||
log.Printf("[WARNING] Error in fetching manager while waiting for instances to come up: %s\n", err) | |||
return nil, "error", err | |||
} | |||
if creatingCount := m.CurrentActions.Creating + m.CurrentActions.CreatingWithoutRetries; creatingCount > 0 { | |||
return creatingCount, "creating", nil | |||
if done := m.CurrentActions.None; done < m.TargetSize { |
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.
slaps forehead
I think I remember writing this code, so thanks for catching my mistake there - obviously the instances shouldn't report ready if they're FAILED
.
…ta source (hashicorp#1222) * Add wait_for_instances field to IGM and self_link option to the IG data source * don't be clever with errors
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 #1213.
(even though it's two changes, doing it in a single PR enables the test I wanted to write)