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

Only set enabled bool if evaluation mode is unspecified #9629

Merged

Conversation

rmoriar1
Copy link
Contributor

@rmoriar1 rmoriar1 commented Dec 12, 2023

Remove enable_binary_authorization conditional, this was missed in #8784.

Fixes hashicorp/terraform-provider-google#16759

container: fixed an issue in which migrating from the deprecated Binauthz enablement bool to the new evaluation mode enum inadvertently caused two cluster update events, instead of none.

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@melinath, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@rmoriar1 rmoriar1 marked this pull request as draft December 12, 2023 23:06
@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@rmoriar1 rmoriar1 marked this pull request as ready for review December 13, 2023 20:16
@rmoriar1
Copy link
Contributor Author

The provider crashed while running the VCR tests in REPLAYING mode Please fix it to complete your PR View the build log

Unrelated? I don't see any of the affected tests failing

@modular-magician

This comment was marked as outdated.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 1 file changed, 12 insertions(+), 27 deletions(-))
Terraform Beta: Diff ( 1 file changed, 12 insertions(+), 27 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3292
Passed tests 2953
Skipped tests: 338
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccContainerCluster_withBinaryAuthorizationEnabledBool

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccContainerCluster_withBinaryAuthorizationEnabledBool[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 1 file changed, 13 insertions(+), 28 deletions(-))
Terraform Beta: Diff ( 1 file changed, 13 insertions(+), 28 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3292
Passed tests 2955
Skipped tests: 337
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

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.

Looking over this more closely, I'm not sure I fully understand what the "bad case" that we're trying to prevent is. Left some comments below. Let me know what you think!

Additionally, please update https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/website/docs/guides/version_5_upgrade.html.markdown to specify the correct update path for people who had been using enable_binary_authorization in 4.X.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 25 deletions(-))
Terraform Beta: Diff ( 1 file changed, 20 deletions(-))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 9 insertions(+), 21 deletions(-))
Terraform Beta: Diff ( 2 files changed, 9 insertions(+), 21 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3300
Passed tests 2964
Skipped tests: 336
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

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.

minor docs tweak

@melinath melinath self-requested a review December 18, 2023 19:38
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 9 insertions(+), 21 deletions(-))
Terraform Beta: Diff ( 2 files changed, 9 insertions(+), 21 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3300
Passed tests 2964
Skipped tests: 336
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

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.

LGTM. FWIW I am not able to reproduce the original case that spawned this ticket - the update seems to happen as expected on the main branch (1 single update request) and completes very quickly.

I'm using a different version of Terraform so it's possible that the behavior was changed over time.

All that said, even if the upgrade took two updates, that isn't the main issue. The main issue is correcting the upgrade docs, which this PR does. Eliminating the stray remaining reference to enable_binary_authorization is also good whether or not it's currently causing problems.

@melinath melinath merged commit c1e45b1 into GoogleCloudPlatform:main Dec 20, 2023
12 checks passed
kapreus pushed a commit to kapreus/magic-modules that referenced this pull request Jan 2, 2024
…latform#9629)

* Only set enabled bool if evaluation mode is unspecified

* Only trigger one cluster update event if both both legacy  and  struct blocks have diffs.

* remove inadvertant modifications

* Pass legacy bool to expandBinaryAuthorization fn

* move fn for diff readability

* reformat

* reformat

* Only get enable_binary_authorization if its been changed

* remove commas

* fix logic

* Remove enable_binary_authorization condition

* Add upgrade path docs

* Add comma

* Update mmv1/third_party/terraform/website/docs/guides/version_5_upgrade.html.markdown

---------

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
…latform#9629)

* Only set enabled bool if evaluation mode is unspecified

* Only trigger one cluster update event if both both legacy  and  struct blocks have diffs.

* remove inadvertant modifications

* Pass legacy bool to expandBinaryAuthorization fn

* move fn for diff readability

* reformat

* reformat

* Only get enable_binary_authorization if its been changed

* remove commas

* fix logic

* Remove enable_binary_authorization condition

* Add upgrade path docs

* Add comma

* Update mmv1/third_party/terraform/website/docs/guides/version_5_upgrade.html.markdown

---------

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
…latform#9629)

* Only set enabled bool if evaluation mode is unspecified

* Only trigger one cluster update event if both both legacy  and  struct blocks have diffs.

* remove inadvertant modifications

* Pass legacy bool to expandBinaryAuthorization fn

* move fn for diff readability

* reformat

* reformat

* Only get enable_binary_authorization if its been changed

* remove commas

* fix logic

* Remove enable_binary_authorization condition

* Add upgrade path docs

* Add comma

* Update mmv1/third_party/terraform/website/docs/guides/version_5_upgrade.html.markdown

---------

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad deprecation on google_container_cluster.binary_authorization.enabled
3 participants