mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Make backend.StateMgr accept a context (#780)
Signed-off-by: Marcin Wyszynski <marcin.pixie@gmail.com>
This commit is contained in:
@@ -39,9 +39,11 @@ func (b *Local) LocalRun(op *backend.Operation) (*backend.LocalRun, statemgr.Ful
|
||||
func (b *Local) localRun(op *backend.Operation) (*backend.LocalRun, *configload.Snapshot, statemgr.Full, tfdiags.Diagnostics) {
|
||||
var diags tfdiags.Diagnostics
|
||||
|
||||
ctx := context.TODO()
|
||||
|
||||
// Get the latest state.
|
||||
log.Printf("[TRACE] backend/local: requesting state manager for workspace %q", op.Workspace)
|
||||
s, err := b.StateMgr(op.Workspace)
|
||||
s, err := b.StateMgr(ctx, op.Workspace)
|
||||
if err != nil {
|
||||
diags = diags.Append(fmt.Errorf("error loading state: %w", err))
|
||||
return nil, nil, nil, diags
|
||||
|
||||
Reference in New Issue
Block a user