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

backend/gcs: remove deprecated "path" config argument #26841

Merged
merged 3 commits into from
Nov 6, 2020
Merged

backend/gcs: remove deprecated "path" config argument #26841

merged 3 commits into from
Nov 6, 2020

Conversation

upodroid
Copy link
Contributor

@upodroid upodroid commented Nov 6, 2020

Path was deprecated more than 3 years ago.

This removes it from the code.

Spotted while working on #26700

@upodroid upodroid changed the title backend/gcs: remove path from code backend: remove path from code Nov 6, 2020
@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #26841 (27913eb) into master (d4716a6) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted Files Coverage Δ
backend/remote-state/gcs/backend.go 0.00% <ø> (ø)
backend/remote-state/gcs/backend_state.go 2.98% <ø> (-5.47%) ⬇️
terraform/eval_apply.go 72.86% <0.00%> (-0.59%) ⬇️
states/statefile/version4.go 58.19% <0.00%> (+0.23%) ⬆️

@pkolyvas
Copy link
Contributor

pkolyvas commented Nov 6, 2020

Thanks @upodroid :)

@rileykarson Would you be willing to give this a quick once-over as well?

@pkolyvas pkolyvas added backend/gcs 0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Nov 6, 2020
@@ -45,13 +45,6 @@ func New() backend.Backend {
Description: "The name of the Google Cloud Storage bucket",
},

"path": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Watch out for line 117, where this is still in use: data.Get("path")

It appears the defaultStateFile value is also no longer relevant, since that was the sole thing that set it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trying it now, getting some fun errors when i remove defaultStateFile from the struct and clean up references to it

Copy link
Contributor Author

@upodroid upodroid Nov 6, 2020

Choose a reason for hiding this comment

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

It is working now, not sure what the context for the legacy test is.

REDACTED  MCW0CDP3YY  ~  Desktop  Git  terraform   remove-path-gcs-be  3✎  ERROR  $   TF_ACC=1 go test -v ./backend/remote-state/gcs/
=== RUN   TestStateFile
=== PAUSE TestStateFile
=== RUN   TestRemoteClient
=== PAUSE TestRemoteClient
=== RUN   TestRemoteClientWithEncryption
=== PAUSE TestRemoteClientWithEncryption
=== RUN   TestRemoteLocks
=== PAUSE TestRemoteLocks
=== RUN   TestBackend
=== PAUSE TestBackend
=== RUN   TestBackendWithPrefix
=== PAUSE TestBackendWithPrefix
=== RUN   TestBackendWithEncryption
=== PAUSE TestBackendWithEncryption
=== CONT  TestStateFile
=== CONT  TestBackend
--- PASS: TestStateFile (0.00s)
=== CONT  TestRemoteClient
=== CONT  TestBackendWithEncryption
=== CONT  TestBackendWithPrefix
=== CONT  TestRemoteLocks
    TestRemoteLocks: backend_test.go:96: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4adee3b0-testremotelocks"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("")}}
=== CONT  TestRemoteClientWithEncryption
    TestBackendWithPrefix: backend_test.go:146: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4ade0508-testbackendwithprefix"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("test/prefix")}}
    TestBackendWithEncryption: backend_test.go:159: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4addd628-testbackendwithencryption"), "encryption_key":cty.StringVal("yRyCOikXi1ZDNE0xN3yiFsJjg7LGimoLrGFcLZgQoVk="), "prefix":cty.StringVal("")}}
    TestBackend: backend_test.go:130: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4adc14f0-testbackend"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("")}}
    TestRemoteClient: backend_test.go:57: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4add39e8-testremoteclient"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("")}}
    TestRemoteClientWithEncryption: backend_test.go:76: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4ae5cd38-testremoteclientwithencryption"), "encryption_key":cty.StringVal("yRyCOikXi1ZDNE0xN3yiFsJjg7LGimoLrGFcLZgQoVk="), "prefix":cty.StringVal("")}}
    TestBackendWithPrefix: backend_test.go:149: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4ade0508-testbackendwithprefix"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("test/prefix/")}}
    TestBackendWithEncryption: backend_test.go:162: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4addd628-testbackendwithencryption"), "encryption_key":cty.StringVal("yRyCOikXi1ZDNE0xN3yiFsJjg7LGimoLrGFcLZgQoVk="), "prefix":cty.StringVal("")}}
    TestBackend: backend_test.go:133: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1645030c4adc14f0-testbackend"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("")}}
--- PASS: TestRemoteClient (5.46s)
--- PASS: TestRemoteClientWithEncryption (5.79s)
--- PASS: TestRemoteLocks (6.37s)
    TestBackendWithPrefix: backend_test.go:152: TestBackend: testing state locking for *gcs.Backend
    TestBackend: backend_test.go:136: TestBackend: testing state locking for *gcs.Backend
    TestBackendWithEncryption: backend_test.go:165: TestBackend: testing state locking for *gcs.Backend
--- PASS: TestBackendWithPrefix (15.32s)
    TestBackend: backend_test.go:137: TestBackend: testing state locking for *gcs.Backend
--- PASS: TestBackendWithEncryption (15.87s)
--- PASS: TestBackend (19.85s)
PASS
ok      github.com/hashicorp/terraform/backend/remote-state/gcs 22.278s

@alisdair alisdair changed the title backend: remove path from code backend/gcs: remove deprecated "path" config argument Nov 6, 2020
Copy link
Contributor

@alisdair alisdair left a comment

Choose a reason for hiding this comment

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

Thanks! 🙌

@alisdair alisdair merged commit 3b9c5e5 into hashicorp:master Nov 6, 2020
@alisdair alisdair removed the 0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Nov 6, 2020
@ghost
Copy link

ghost commented Dec 7, 2020

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.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants