Skip to content

gkehub: Fix TestAccGKEHubFeatureMembership_gkehubFeaturePolicyController#16568

Open
BBBmau wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
BBBmau:set-default-auditIntervalSeconds-GKEHub
Open

gkehub: Fix TestAccGKEHubFeatureMembership_gkehubFeaturePolicyController#16568
BBBmau wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
BBBmau:set-default-auditIntervalSeconds-GKEHub

Conversation

@BBBmau
Copy link
Collaborator

@BBBmau BBBmau commented Feb 27, 2026

We've been seeing consistent failures when looking at nightly-tests:

=== CONT  TestAccGKEHubFeatureMembership_gkehubFeaturePolicyController
    resource_gke_hub_feature_membership_test.go:949: Step 3/6 error: After applying this test step, the plan was not empty.
        stdout:
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        Terraform will perform the following actions:
          # google_gke_hub_feature_membership.feature_member will be updated in-place
          ~ resource "google_gke_hub_feature_membership" "feature_member" {
                id                  = "projects/tf-test-gkehub4u4h8qe4f1/locations/global/features/policycontroller/membershipId/tf-test14u4h8qe4f1"
                # (5 unchanged attributes hidden)
              ~ policycontroller {
                    # (1 unchanged attribute hidden)
                  ~ policy_controller_hub_config {
                      - audit_interval_seconds     = 60 -> null
                        # (6 unchanged attributes hidden)
                        # (4 unchanged blocks hidden)
                    }
                }
            }
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccGKEHubFeatureMembership_gkehubFeaturePolicyController (1205.07s)

It appears that the value audit-interval_seconds has a default value set by the api when no value is set. Because of this we get a plan not empty after the third step configuration is applied due to the configuration not containing a value set on audit_interval_second

We should see a passing VCR test on TestAccGKEHubFeatureMembership_gkehubFeaturePolicyController

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@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, 2 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field policycontroller.policy_controller_hub_config.audit_interval_seconds default value changed from <nil> to 60 on google_gke_hub_feature_membership - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@BBBmau BBBmau requested a review from rileykarson February 27, 2026 23:05
Copy link
Collaborator Author

@BBBmau BBBmau left a comment

Choose a reason for hiding this comment

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

Addressing the breaking change comment, this wouldn't be a breaking change as it already performs the default set on the API side. I don't think we have the ability to set Computed override on DCL resources. I can look into adding this in if we choose not to go with a client-side default value

Comment on lines 36 to 39
- type: CUSTOM_DEFAULT
field: policycontroller.policy_controller_hub_config.audit_interval_seconds
details:
default: 60 No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- type: CUSTOM_DEFAULT
field: policycontroller.policy_controller_hub_config.audit_interval_seconds
details:
default: 60
- type: CUSTOM_SCHEMA_VALUES
field: policycontroller.policy_controller_hub_config.audit_interval_seconds
details:
computed: true

I may have that syntax wrong, but that's roughly what we need for O+C I think! tpgtools was very literal about replacements of things in overrides, since we'd have expected to make most nontrivial changes against the DCL itself.

@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, 8 insertions(+), 9 deletions(-))
google-beta provider: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field policycontroller.policy_controller_hub_config.audit_interval_seconds became Computed only on google_gke_hub_feature_membership - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants