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

Instance group wait for status #4783

Merged
merged 5 commits into from
May 26, 2021

Conversation

slevenick
Copy link
Contributor

Fixes: hashicorp/terraform-provider-google#8311

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

compute: added support for output-only `status` field on `google_compute_instance_group_manager` and `google_compute_region_instance_group_manager`
compute: added support for `wait_for_instances_status` on `google_compute_instance_group_manager` and `google_compute_region_instance_group_manager`

@google-cla google-cla bot added the cla: yes label May 13, 2021
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 5 files changed, 208 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 5 files changed, 208 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=187192"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 5 files changed, 208 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 5 files changed, 208 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=187380"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccInstanceGroupManager_stateful|TestAccRegionInstanceGroupManager_distributionPolicy You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=187386"

"wait_for_instances_status": {
Type: schema.TypeString,
Optional: true,
Default: "STABLE",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a check on this value in Read- if it's "", set it to "STABLE". That way we get away without a state upgrader and don't have a one-off diff for resources provisioned with older provider versions.

When `STABLE` is specified this resource will wait until the instances are stable before returning. When `UPDATED` is
set, it will wait for the version target to be reached and any per instance configs to be effective as well as all
instances to be stable before returning. The possible values are `STABLE` and `UPDATED`

---

* `auto_healing_policies` - (Optional) The autohealing policies for this managed instance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to document the attribute fields under status too, right?

@@ -790,6 +790,7 @@ resource "google_compute_instance_group_manager" "manager" {
// block on instances being ready so that when they get deleted, we don't try
// to continue interacting with them in other resources
wait_for_instances = true
wait_for_instances_status = "UPDATED"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this changed due to a failing test, or just to ensure we use it somewhere? If it's just to use it, can we do so in an IGM-specific test?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can that test migrate from one to the other?

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 5 files changed, 424 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 5 files changed, 424 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=188946"

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM- if you don't mind provisioning a MIG with an old version and then updating to the dev provider including this change locally, that will ensure that we handle the state transition correctly.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 5 files changed, 424 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 5 files changed, 424 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=189109"

@slevenick
Copy link
Contributor Author

LGTM- if you don't mind provisioning a MIG with an old version and then updating to the dev provider including this change locally, that will ensure that we handle the state transition correctly.

Yup, wait_for_instances_status gets set to STABLE in state with no diff

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccInstanceGroupManager_waitForStatus You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=189203"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for MIG.versionTarget.isReached output
3 participants