-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Conversation
Codecov Report
|
Thanks @upodroid :) @rileykarson Would you be willing to give this a quick once-over as well? |
@@ -45,13 +45,6 @@ func New() backend.Backend { | |||
Description: "The name of the Google Cloud Storage bucket", | |||
}, | |||
|
|||
"path": { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove deadcode
removed the last non-test setter, but I think we can remove it at https://github.com/hashicorp/terraform/blob/master/backend/remote-state/gcs/backend.go#L32 and in https://github.com/hashicorp/terraform/blob/master/backend/remote-state/gcs/backend_state.go + https://github.com/hashicorp/terraform/blob/master/backend/remote-state/gcs/backend_test.go too?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🙌
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. |
Path was deprecated more than 3 years ago.
This removes it from the code.
Spotted while working on #26700