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

Return current state when requesting deferral. #2570

Merged
merged 6 commits into from
Aug 14, 2024

Conversation

alexsomesan
Copy link
Member

@alexsomesan alexsomesan commented Aug 13, 2024

Description

Returns current state durring planning and reading resources that require deferral.
This is to correlate with new expectations of Terraform core introduced in: hashicorp/terraform#35526

Testing this change requires running with an up-to-date build of Terraform, that includes the above mentioned PR. A build from current main would be ideal.

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

Without this change:

$ go test -v -run '^TestAccKubernetesDeferredActions' ./kubernetes/test-dfa
=== RUN   TestAccKubernetesDeferredActions_2_step
    deferred_actions_test.go:28: Step 1/3 error: Error running pre-apply plan: exit status 1

        Error: Attempt to get attribute from null value

          on workspace.tf line 13, in resource "kubernetes_manifest" "demo_workspace":
          13:     kind       = kubernetes_manifest.crd_workspaces.object.spec.names.kind
            ├────────────────
            │ kubernetes_manifest.crd_workspaces.object is null

        This value is null, so it does not have any attributes.
--- FAIL: TestAccKubernetesDeferredActions_2_step (4.35s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-kubernetes/kubernetes/test-dfa	5.424s
FAIL

With this change:

$ go test -v -run '^TestAccKubernetesDeferredActions' ./kubernetes/test-dfa
=== RUN   TestAccKubernetesDeferredActions_2_step
--- PASS: TestAccKubernetesDeferredActions_2_step (41.58s)
PASS
ok  	github.com/hashicorp/terraform-provider-kubernetes/kubernetes/test-dfa	42.673s

Release Note

Release note for CHANGELOG:

deferred actions: return unknown value instead of nil when requesting deferral of a planned resource change.

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@alexsomesan alexsomesan force-pushed the deferred-returns-proposed branch from 104a29c to 42b6d04 Compare August 14, 2024 09:44
@alexsomesan alexsomesan marked this pull request as ready for review August 14, 2024 09:53
@alexsomesan alexsomesan requested a review from a team as a code owner August 14, 2024 09:53
@alexsomesan alexsomesan merged commit bfd8d84 into main Aug 14, 2024
64 checks passed
@alexsomesan alexsomesan deleted the deferred-returns-proposed branch August 14, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants