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

Failing test(s): TestAccAssuredWorkloadsWorkload_FullHandWritten (GA) #16460

Closed
SarahFrench opened this issue Nov 7, 2023 · 3 comments · Fixed by GoogleCloudPlatform/magic-modules#9420 or #16465

Comments

@SarahFrench
Copy link
Member

SarahFrench commented Nov 7, 2023

Failure rates

  • 100% since 2023-11-03
Screenshot 2023-11-07 at 11 03 19

Impacted tests

  • TestAccAssuredWorkloadsWorkload_FullHandWritten

Affected Resource(s)

  • google_assured_workloads_workload

Nightly build test history

Message(s)

Diff from violation_notifications_enabled forces replacement

------- Stdout: -------
=== RUN   TestAccAssuredWorkloadsWorkload_FullHandWritten
=== PAUSE TestAccAssuredWorkloadsWorkload_FullHandWritten
=== CONT  TestAccAssuredWorkloadsWorkload_FullHandWritten
    vcr_utils.go:152: Step 1/2 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:
        -/+ destroy and then create replacement
        Terraform will perform the following actions:
          # google_assured_workloads_workload.primary must be replaced
        -/+ resource "google_assured_workloads_workload" "primary" {
              ~ compliance_status                 = [
                  - {
                      - acknowledged_violation_count = []
                      - active_violation_count       = []
                    },
                ] -> (known after apply)
              ~ compliant_but_disallowed_services = [] -> (known after apply)
              ~ create_time                       = "2023-11-03T10:16:59.219361Z" -> (known after apply)
              ~ effective_labels                  = {} -> (known after apply)
              ~ ekm_provisioning_response         = [] -> (known after apply)
              - enable_sovereign_controls         = false -> null
              ~ id                                = "organizations/*******/locations/us-central1/workloads/00-f987c094-1081-4cab-8a17-527" -> (known after apply)
              + kaj_enrollment_state              = (known after apply)
              ~ name                              = "00-f987c094-1081-4cab-8a17-527" -> (known after apply)
              ~ resources                         = [
                  - {
                      - resource_id   = 910439807444
                      - resource_type = "ENCRYPTION_KEYS_PROJECT"
                    },
                  - {
                      - resource_id   = 1068176858711
                      - resource_type = "CONSUMER_FOLDER"
                    },
                ] -> (known after apply)
              ~ saa_enrollment_response           = [] -> (known after apply)
              ~ terraform_labels                  = {} -> (known after apply)
              - violation_notifications_enabled   = true -> null # forces replacement
                # (6 unchanged attributes hidden)
                # (1 unchanged block hidden)
            }
        Plan: 1 to add, 0 to change, 1 to destroy.
--- FAIL: TestAccAssuredWorkloadsWorkload_FullHandWritten (65.20s)
FAIL

b/309602192

@SarahFrench
Copy link
Member Author

Seems to be linked to GoogleCloudPlatform/magic-modules#9370

@SarahFrench
Copy link
Member Author

SarahFrench commented Nov 7, 2023

It looks like the violation_notifications_enabled field is being read into state (the API returns a true value) but this results in a permadiff because the field is Optional only, not Optional+Computed. This means the lack of violation_notifications_enabled in the Terraform config will cause a plan to remove the unexpected true value in state

"violation_notifications_enabled": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Description: "Optional. Indicates whether the e-mail notification for a violation is enabled for a workload. This value will be by default True, and if not present will be considered as true. This should only be updated via updateWorkload call. Any Changes to this field during the createWorkload call will not be honored. This will always be true while creating the workload.",
},

However in the Beta version of the provider the field is O+C. Seems the problem is that the beta provider has an override that's missing in the GA provider

Copy link

github-actions bot commented Dec 8, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.