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

Backport of Backend/COS: remove COS object lock tag either when unlock remote state into v1.2 #31247

Merged

Conversation

teamterraform
Copy link
Contributor

Backport

This PR is auto-generated from #31223 to be assessed for backporting due to the inclusion of the label 1.2-backport.

The below text is copied from the body of the original PR.


When running command terraform force-unlock , the remote state file will be removed as expect. However, the tencentcloud-terraform-lock tag will not removed at the same time in some unexpected program exit cases. Creating this PR is purpose to ensure the tag removed to get rid of impact of next terraform operation.

Here shows the unit test output:

$ TF_ACC=1 go test -v ./internal/backend/remote-state/cos

=== RUN   TestStateFile
=== PAUSE TestStateFile
=== RUN   TestRemoteClient
=== PAUSE TestRemoteClient
=== RUN   TestRemoteClientWithPrefix
=== PAUSE TestRemoteClientWithPrefix
=== RUN   TestRemoteClientWithEncryption
=== PAUSE TestRemoteClientWithEncryption
=== RUN   TestRemoteLocks
=== PAUSE TestRemoteLocks
=== RUN   TestBackend
=== PAUSE TestBackend
=== RUN   TestBackendWithPrefix
=== PAUSE TestBackendWithPrefix
=== RUN   TestBackendWithEncryption
=== PAUSE TestBackendWithEncryption
=== CONT  TestBackendWithPrefix
=== CONT  TestStateFile
=== RUN   TestStateFile/_default.tfstate_default
=== CONT  TestBackend
=== RUN   TestStateFile/_test.tfstate_default
=== RUN   TestStateFile/_test.tfstate_dev
=== RUN   TestStateFile/terraform/test_default.tfstate_default
=== CONT  TestRemoteLocks
=== CONT  TestRemoteClientWithEncryption
=== CONT  TestRemoteClientWithPrefix
=== CONT  TestRemoteClient
=== CONT  TestBackendWithEncryption
=== CONT  TestBackend
=== CONT  TestBackendWithPrefix
=== CONT  TestRemoteClientWithPrefix
=== CONT  TestBackendWithEncryption
=== CONT  TestRemoteClient
=== RUN   TestStateFile/terraform/test_test.tfstate_default
=== CONT  TestRemoteClientWithEncryption
=== CONT  TestRemoteLocks
=== RUN   TestStateFile/terraform/test_test.tfstate_dev
--- PASS: TestStateFile (0.00s)
    --- PASS: TestStateFile/_default.tfstate_default (0.00s)
    --- PASS: TestStateFile/_test.tfstate_default (0.00s)
    --- PASS: TestStateFile/_test.tfstate_dev (0.00s)
    --- PASS: TestStateFile/terraform/test_default.tfstate_default (0.00s)
    --- PASS: TestStateFile/terraform/test_test.tfstate_default (0.00s)
    --- PASS: TestStateFile/terraform/test_test.tfstate_dev (0.00s)
=== CONT  TestBackendWithPrefix
=== CONT  TestBackendWithEncryption
=== CONT  TestBackend
--- PASS: TestRemoteClientWithPrefix (1.79s)
--- PASS: TestRemoteClientWithEncryption (1.84s)
--- PASS: TestRemoteClient (1.90s)
--- PASS: TestRemoteLocks (3.25s)
=== CONT  TestBackend
=== CONT  TestBackendWithEncryption
=== CONT  TestBackendWithPrefix
=== CONT  TestBackend
    testing.go:300: TestBackend: testing state locking for *cos.Backend
=== CONT  TestBackendWithEncryption
    testing.go:300: TestBackend: testing state locking for *cos.Backend
=== CONT  TestBackendWithPrefix
    testing.go:300: TestBackend: testing state locking for *cos.Backend
=== CONT  TestBackend
    testing.go:300: TestBackend: testing state locking for *cos.Backend
--- PASS: TestBackendWithEncryption (6.95s)
--- PASS: TestBackendWithPrefix (7.01s)
--- PASS: TestBackend (9.15s)
PASS
ok      github.com/hashicorp/terraform/internal/backend/remote-state/cos        9.532s

@teamterraform teamterraform force-pushed the backport/fix/cos-backend-unlock-tag/terribly-engaged-rhino branch from bc9833e to 0449431 Compare June 14, 2022 16:21
@jbardin jbardin merged commit f26deaa into v1.2 Jun 14, 2022
@jbardin jbardin deleted the backport/fix/cos-backend-unlock-tag/terribly-engaged-rhino branch June 14, 2022 16:35
@github-actions
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Jul 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants