Skip to content

Commit

Permalink
backend: Operation.Environment renamed to "Workspace"
Browse files Browse the repository at this point in the history
This is part of an effort to switch this terminology across all of
Terraform.
  • Loading branch information
apparentlymart committed Jun 9, 2017
1 parent 5a57962 commit f7ce6a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion backend/local/backend_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion command/meta_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit f7ce6a1

Please sign in to comment.