backend: Operation.Environment renamed to "Workspace"

This is part of an effort to switch this terminology across all of
Terraform.
This commit is contained in:
Martin Atkins 2017-05-31 09:37:31 -07:00
parent 5a57962a32
commit f7ce6a15f8
3 changed files with 5 additions and 4 deletions

View File

@ -136,8 +136,9 @@ type Operation struct {
// The duration to retry obtaining a State lock. // The duration to retry obtaining a State lock.
StateLockTimeout time.Duration StateLockTimeout time.Duration
// Environment is the named state that should be loaded from the Backend. // Workspace is the name of the workspace that this operation should run
Environment string // in, which controls which named state is used.
Workspace string
} }
// RunningOperation is the result of starting an operation. // RunningOperation is the result of starting an operation.

View File

@ -23,7 +23,7 @@ func (b *Local) Context(op *backend.Operation) (*terraform.Context, state.State,
func (b *Local) context(op *backend.Operation) (*terraform.Context, state.State, error) { func (b *Local) context(op *backend.Operation) (*terraform.Context, state.State, error) {
// Get the state. // Get the state.
s, err := b.State(op.Environment) s, err := b.State(op.Workspace)
if err != nil { if err != nil {
return nil, nil, errwrap.Wrapf("Error loading state: {{err}}", err) return nil, nil, errwrap.Wrapf("Error loading state: {{err}}", err)
} }

View File

@ -168,7 +168,7 @@ func (m *Meta) Operation() *backend.Operation {
PlanOutBackend: m.backendState, PlanOutBackend: m.backendState,
Targets: m.targets, Targets: m.targets,
UIIn: m.UIInput(), UIIn: m.UIInput(),
Environment: m.Workspace(), Workspace: m.Workspace(),
LockState: m.stateLock, LockState: m.stateLock,
StateLockTimeout: m.stateLockTimeout, StateLockTimeout: m.stateLockTimeout,
} }