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

set ignore_read for noRemoveDataDisk #4403

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

edwardmedia
Copy link
Contributor

@edwardmedia edwardmedia commented Jan 14, 2021

Fixes hashicorp/terraform-provider-google#8216

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)

notebooks: fixed permadiff on noRemoveDataDisk for `google_notebooks_instance`

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

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@melinath, please review this PR or find an appropriate assignee.

@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 ( 2 files changed, 4 insertions(+), 11 deletions(-))
Terraform Beta: Diff ( 2 files changed, 4 insertions(+), 11 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=167150"

@modular-magician
Copy link
Collaborator

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

@melinath
Copy link
Member

melinath commented Jan 15, 2021

Hi Edward! I'm not familiar with this resource, so please bear with me :-)

My understanding is that ignore_read is primarily intended for situations where the return value isn't useful for some reason (like secrets). It seems like it would also prevent a permadiff in this case - but I'm concerned that we might be ignoring a diff that is real and the result of some other bug. I.e. if the value isn't being set correctly remotely, why is that? Is it safe to ignore?

The user also reported their main concern being that updating metadata or no_remove_data_disk caused the instance to be destroyed and recreated. It seems like the current PR does not address that issue - is that correct?

@edwardmedia
Copy link
Contributor Author

edwardmedia commented Jan 17, 2021

@melinath the key problem here is API does not return no_remove_data_disk (not in the response), thus its state was not updated accordingly. Setting it with ignore_read will force to sync its state with the config, which could avoid the diff.
During my test, I am not able to see the diff in metadata.

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

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

Gotcha - that makes sense! Looking at the API and comparing it to the terraform.yaml file, it seems like all the "input only" fields have been marked ignore_read. That seems like it's an API bug to not let us read those fields out but I guess that's how it is 😂 thanks :-)

(Also since no_remove_data_disk is input only, it makes sense that changing it would force new.)

This LGTM, though it would be nice to have a test that would have caught this issue.

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.

Unexpected machine re-creation while using resource google_notebooks_instance
3 participants