mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-09 15:43:53 -06:00
ee2e390f85
Move the Swift State from a legacy remote state to an official backend. Add `container` and `archive_container` configuration variables, and deprecate `path` and `archive_path` variables. Future improvements: Add support for locking and environments.
32 lines
746 B
Go
32 lines
746 B
Go
package swift
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/backend"
|
|
"github.com/hashicorp/terraform/state"
|
|
"github.com/hashicorp/terraform/state/remote"
|
|
)
|
|
|
|
func (b *Backend) States() ([]string, error) {
|
|
return nil, backend.ErrNamedStatesNotSupported
|
|
}
|
|
|
|
func (b *Backend) DeleteState(name string) error {
|
|
return backend.ErrNamedStatesNotSupported
|
|
}
|
|
|
|
func (b *Backend) State(name string) (state.State, error) {
|
|
if name != backend.DefaultStateName {
|
|
return nil, backend.ErrNamedStatesNotSupported
|
|
}
|
|
|
|
client := &RemoteClient{
|
|
client: b.client,
|
|
container: b.container,
|
|
archive: b.archive,
|
|
archiveContainer: b.archiveContainer,
|
|
expireSecs: b.expireSecs,
|
|
}
|
|
|
|
return &remote.State{Client: client}, nil
|
|
}
|