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.
StateLockTimeout time.Duration
// Environment is the named state that should be loaded from the Backend.
Environment string
// Workspace is the name of the workspace that this operation should run
// in, which controls which named state is used.
Workspace string
}
// 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) {
// Get the state.
s, err := b.State(op.Environment)
s, err := b.State(op.Workspace)
if err != nil {
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,
Targets: m.targets,
UIIn: m.UIInput(),
Environment: m.Workspace(),
Workspace: m.Workspace(),
LockState: m.stateLock,
StateLockTimeout: m.stateLockTimeout,
}