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

Fix perma-diff in google_container_cluster when cluster_dns_scope is unspecified #13150

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Michcioperz
Copy link
Contributor

Terraform defaults this field to DNS_SCOPE_UNSPECIFIED, but the API
corrects this to an empty value.

Following https://googlecloudplatform.github.io/magic-modules/develop/diffs/#default_if_empty
to tackle this issue.

To make writing DNS tests faster, I refactored the helper function testAccContainerCluster_autopilot_withDNSConfig I added previously into testAccContainerCluster_withAdvancedDNSConfig.

Fixes hashicorp/terraform-provider-google#20285

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

container: fixed perma-diff in `google_container_cluster` when `cluster_dns_scope` is unspecified

@github-actions github-actions bot requested a review from melinath February 21, 2025 11:27
Copy link

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

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

@Michcioperz Michcioperz changed the title Push pmpsknrzmxnm Fix perma-diff in google_container_cluster when cluster_dns_scope is unspecified Feb 21, 2025
@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, 54 insertions(+), 14 deletions(-))
google-beta provider: Diff ( 2 files changed, 54 insertions(+), 14 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 226
Passed tests: 214
Skipped tests: 11
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_cloudDns_nil_scope

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccContainerCluster_cloudDns_nil_scope [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

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.

google provider: Diff ( 2 files changed, 54 insertions(+), 14 deletions(-))
google-beta provider: Diff ( 2 files changed, 54 insertions(+), 14 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 226
Passed tests: 214
Skipped tests: 11
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_cloudDns_nil_scope

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccContainerCluster_cloudDns_nil_scope [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

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.

We usually don't include UNSPECIFIED values in enums because they're the equivalent of the empty string.

Changing default values or making validation stricter is a breaking change; however, given that users are experiencing a bug (this permadiff) I think it would fall under the fixing a bug exemption and be allowed in a minor release.

In particular, I would recommend:

  1. Remove the default (which would be the same as changing to Default: "").
  2. Remove DNS_SCOPE_UNSPECIFIED from the ValidateFunc for the field so that it is no longer an allowed value.

What would you think of that? Any objection?

@melinath melinath added the override-breaking-change Allows a potential breaking change to be merged label Feb 24, 2025
@Michcioperz
Copy link
Contributor Author

Remove DNS_SCOPE_UNSPECIFIED from the ValidateFunc for the field so that it is no longer an allowed value.

@melinath Ah, so the idea here would be that, since setting this value is always causing permadiff right now, it's okay if we disallow it and force people change it to empty? Is that the rationale more or less?

@github-actions github-actions bot requested a review from melinath February 25, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
override-breaking-change Allows a potential breaking change to be merged service/container
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google_container_clusterdns_config.cluster_dns_scope is always detected as an update
3 participants