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

Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set #10101

Merged

Conversation

Francis-Liu
Copy link
Contributor

@Francis-Liu Francis-Liu commented Mar 3, 2024

For private flexible clusters, user are still allowed to set master_ipv4_cidr_block. In this situation, private_endpoint_subnetwork will return a non-empty subnet name, which doesn't match the empty subnet in Terraform config (user can set either cidr block or subnet, or neither, but not both, which is error-checked by API). We should ignore the subnet diff in this case. This PR is intended to fix the same issue #10089 attempted to fix. #10089 was reverted by #10096.

Release Note Template for Downstream PRs (will be copied)

container: fixed `google_container_cluster` permadiff when `master_ipv4_cidr_block` is set for a private flexible cluster

@Francis-Liu Francis-Liu marked this pull request as draft March 3, 2024 20:15
Copy link

github-actions bot commented Mar 3, 2024

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@SarahFrench, 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.

@github-actions github-actions bot requested a review from SarahFrench March 3, 2024 20:16
@Francis-Liu Francis-Liu force-pushed the Francis-Liu/suppress-subnet branch 2 times, most recently from 07731db to 4de9c66 Compare March 4, 2024 18:42
@Francis-Liu Francis-Liu force-pushed the Francis-Liu/suppress-subnet branch from 4de9c66 to 8ce0dbd Compare March 7, 2024 17:24
@Francis-Liu Francis-Liu marked this pull request as ready for review March 7, 2024 20:36
@Francis-Liu
Copy link
Contributor Author

@SarahFrench a kindly reminder

@SarahFrench
Copy link
Contributor

Thanks! This had fallen off my radar

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

google provider: Diff ( 1 file changed, 9 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 1 file changed, 9 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 185
Passed tests: 173
Skipped tests: 12
Affected tests: 0

Click here to see the affected service packages
  • container

$\textcolor{green}{\textsf{All tests passed!}}$
View the build log

@SarahFrench
Copy link
Contributor

/gcbrun

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Mar 15, 2024
@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.

google provider: Diff ( 1 file changed, 9 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 1 file changed, 9 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 185
Passed tests: 173
Skipped tests: 12
Affected tests: 0

Click here to see the affected service packages
  • container

$\textcolor{green}{\textsf{All tests passed!}}$
View the build log

Copy link
Contributor

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Hi @Francis-Liu - the code changes make sense to me, but I'm wondering about what testing can be done to verify this change.

Am I right that prior to this PR's changes a user would provision a private flexible cluster with master_ipv4_cidr_block set and on the next apply Terraform would suggest to replace the whole cluster due to the detected diff?

Would you be comfortable adding a new acceptance test or updating an existing one so that it fails prior to this change (due to a non-empty plan) and passes afterwards? By default the test framework will not expect a non empty plan and will fail after provisioning something, which suggests we might not have a test that provisions a cluster configured in the way that triggers this problem.

@Francis-Liu
Copy link
Contributor Author

Am I right that prior to this PR's changes a user would provision a private flexible cluster with master_ipv4_cidr_block set and on the next apply Terraform would suggest to replace the whole cluster due to the detected diff?

Yes. Precisely, the diff is in private_endpoint_subnetwork. What's interesting about this PR is, it's preparing for our next API change. Currently, there is no diff in private_endpoint_subnetwork with our API, with or without this PR, TF wouldn't suggest to replace the whole cluster. Once this PR is released, we are about to make the change such that the returned private_endpoint_subnetwork will be non empty when master_ipv4_cidr_block is set.

@Francis-Liu
Copy link
Contributor Author

Let me try to add a acceptance test case as you suggested, to capture potential failures after we make the further API change.

@SarahFrench
Copy link
Contributor

SarahFrench commented Mar 15, 2024

Thanks, that'd be useful to have!

I asked in the provider team for advice about how to time this release with the API update.

Next week I'm at a conference so won't be able to review things properly until March 25th onwards. If this PR needs to be reviewed and merged earlier, to enable release on a specific date please let us know.

@SarahFrench
Copy link
Contributor

Following on from above, handing off to our on-call for the next week: @roaks3. Ryan, if this PR doesn't need anything before the 25th please feel free to reassign back to me

@SarahFrench SarahFrench requested a review from roaks3 March 15, 2024 19:38
@github-actions github-actions bot requested a review from SarahFrench March 18, 2024 21:17
@Francis-Liu
Copy link
Contributor Author

@roaks3 I have added the acceptance test. Could you please approve & merge this PR so it goes to release 5.22.0

@roaks3
Copy link
Contributor

roaks3 commented Mar 19, 2024

/gcbrun

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Mar 19, 2024
@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Mar 19, 2024
@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.

google provider: Diff ( 2 files changed, 58 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 58 insertions(+), 1 deletion(-))

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

google provider: Diff ( 2 files changed, 58 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 58 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 186
Passed tests: 173
Skipped tests: 12
Affected tests: 1

Click here to see the affected service packages
  • container

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_withCidrBlockWithoutPrivateEndpointSubnetwork

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerCluster_withCidrBlockWithoutPrivateEndpointSubnetwork[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@Francis-Liu Francis-Liu force-pushed the Francis-Liu/suppress-subnet branch from 7ee8e93 to 2b7dcb8 Compare March 25, 2024 14:32
@Francis-Liu
Copy link
Contributor Author

/gcbrun

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

google provider: Diff ( 2 files changed, 64 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 64 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 186
Passed tests: 173
Skipped tests: 12
Affected tests: 1

Click here to see the affected service packages
  • container

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_withCidrBlockWithoutPrivateEndpointSubnetwork

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerCluster_withCidrBlockWithoutPrivateEndpointSubnetwork[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@Francis-Liu Francis-Liu force-pushed the Francis-Liu/suppress-subnet branch from 2b7dcb8 to 49f94b9 Compare March 25, 2024 19:36
@Francis-Liu
Copy link
Contributor Author

/gcbrun

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

google provider: Diff ( 2 files changed, 65 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 65 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 186
Passed tests: 173
Skipped tests: 12
Affected tests: 1

Click here to see the affected service packages
  • container

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_withCidrBlockWithoutPrivateEndpointSubnetwork

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

$\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

@SarahFrench SarahFrench removed their request for review March 26, 2024 09:43
@roaks3 roaks3 merged commit e6dbde8 into GoogleCloudPlatform:main Mar 26, 2024
10 of 11 checks passed
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Mar 27, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
pjotrekk pushed a commit to pjotrekk/magic-modules that referenced this pull request Apr 2, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
cmfeng pushed a commit to cmfeng/cmfeng-magic-modules that referenced this pull request Apr 5, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Apr 9, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request Apr 19, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
pawelJas pushed a commit to pawelJas/magic-modules that referenced this pull request May 16, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[email protected]>
Cheriit pushed a commit to Cheriit/magic-modules that referenced this pull request Jun 4, 2024
…et (GoogleCloudPlatform#10101)

* Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

* acceptance test: Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set

Signed-off-by: Francis Liu <[email protected]>

---------

Signed-off-by: Francis Liu <[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.

4 participants