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 config_sync.enabled field to true to fix broken tests #11880

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

haiyanmeng
Copy link
Contributor

@haiyanmeng haiyanmeng commented Oct 1, 2024

Terraform google provider v5.41.0 (released on Aug 12, 2024) introduced a new field config_sync.enabled to the google_gke_hub_feature_membership resource. The default value of this field is false. However, when the field is omitted from the Terraform resource, Terraform sets the field to false in the ACM Hub API explicitly. This issue causes the Terraform users to fail to install Config Sync unless they set the new field to true explicitly.

To mitigate this issue, we enhanced the Hub CLH to throw an error if Config Sync is explicitly disabled and the Git or OCI configuration is set.

Our Terraform users need to set the new field to true explicitly to install Config Sync from v5.41.0. For existing CS installations, upgrading from Terraform versions prior to v5.41.0 to versions >= v5.41.0 does not break users, and does not uninstall Config Sync.

part of hashicorp/terraform-provider-google#14591.

Release Note Template for Downstream PRs (will be copied)


Copy link

github-actions bot commented Oct 1, 2024

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

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 11
Passed tests: 6
Skipped tests: 5
Affected tests: 0

Click here to see the affected service packages
  • gkehub

🟢 All tests passed!

View the build log

Terraform google provider v5.41.0 (released on Aug 12, 2024) introduced
a new field `config_sync.enabled` to the google_gke_hub_feature_membership
resource (b/322551829). The default value of this field is false.
However, when the field is omitted from the Terraform resource,
Terraform sets the field to false in the ACM Hub API explicitly. This
issue causes the Terraform users to fail to install Config Sync unless
they set the new field to true explicitly.

To mitigate this issue, we enhanced the Hub CLH to throw an error if
Config Sync is explicitly disabled and the Git or OCI configuration is
set.

Our Terraform users need to set the new field to true explicitly to
install Config Sync from v5.41.0. For existing CS installations,
upgrading from Terraform versions prior to v5.41.0 to versions >=
v5.41.0 does not break users, and does not uninstall Config Sync.
@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, 10 insertions(+))
google-beta provider: Diff ( 1 file changed, 10 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 11
Passed tests: 6
Skipped tests: 5
Affected tests: 0

Click here to see the affected service packages
  • gkehub

🟢 All tests passed!

View the build log

@zli82016
Copy link
Member

zli82016 commented Oct 1, 2024

These two tests passed with the fix in this PR.
TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci TestAccGKEHubFeatureMembership_gkehubFeatureAcmAllFields

The error for configSync.enabled is addressed for TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate. It fails with a perma-diff., which can be fixed in a separate PR.

------- Stdout: -------
=== RUN   TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
=== PAUSE TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
=== CONT  TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
    resource_gke_hub_feature_membership_test.go:33: Step 5/8 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_2 will be updated in-place
          ~ resource "google_gke_hub_feature_membership" "feature_member_2" {
                id                  = "projects/tf-test-gkehub6x1lctrxgf/locations/global/features/configmanagement/membershipId/tf-test26x1lctrxgf"
                # (5 unchanged attributes hidden)
              ~ configmanagement {
                    # (2 unchanged attributes hidden)
                  ~ policy_controller {
                      ~ audit_interval_seconds     = "10" -> "9"
                      ~ exemptable_namespaces      = [
                          ~ "asdf" -> "different",
                            "1234",
                        ]
                      ~ template_library_installed = true -> false
                        # (4 unchanged attributes hidden)
                        # (1 unchanged block hidden)
                    }
                    # (2 unchanged blocks hidden)
                }
            }
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate (918.17s)

Copy link
Member

@zli82016 zli82016 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fixing.

@zli82016 zli82016 merged commit d7a7ea3 into GoogleCloudPlatform:main Oct 1, 2024
13 checks passed
karolgorc pushed a commit to karolgorc/magic-modules that referenced this pull request Oct 4, 2024
niharika-98 pushed a commit to niharika-98/magic-modules that referenced this pull request Oct 7, 2024
trodge pushed a commit to trodge/magic-modules that referenced this pull request Oct 10, 2024
karolgorc pushed a commit to karolgorc/magic-modules that referenced this pull request Oct 11, 2024
gontech pushed a commit to gontech/magic-modules that referenced this pull request Oct 16, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 23, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 24, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 5, 2024
akshat-jindal-nit pushed a commit to akshat-jindal-nit/magic-modules that referenced this pull request Nov 18, 2024
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