Skip to content

Commit 6f0f75d

Browse files
committed
Stop prepareBackend taking locks as argument
1 parent bc6ce98 commit 6f0f75d

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

internal/command/meta_backend.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ func (m *Meta) updateSavedBackendHash(cHash int, sMgr *clistate.LocalState) tfdi
15841584
// This method should be used in NON-init operations only; it's incapable of processing new init command CLI flags used
15851585
// for partial configuration, however it will use the backend state file to use partial configuration from a previous
15861586
// init command.
1587-
func (m *Meta) prepareBackend(root *configs.Module, locks *depsfile.Locks) (backendrun.OperationsBackend, tfdiags.Diagnostics) {
1587+
func (m *Meta) prepareBackend(root *configs.Module) (backendrun.OperationsBackend, tfdiags.Diagnostics) {
15881588
var diags tfdiags.Diagnostics
15891589

15901590
var opts *BackendOpts
@@ -1601,16 +1601,15 @@ func (m *Meta) prepareBackend(root *configs.Module, locks *depsfile.Locks) (back
16011601
case root.StateStore != nil:
16021602
// In addition to config, use of a state_store requires
16031603
// provider factory and provider locks data
1604-
factory, fDiags := m.GetStateStoreProviderFactory(root.StateStore, locks)
1605-
diags = diags.Append(fDiags)
1606-
if fDiags.HasErrors() {
1604+
locks, lDiags := m.lockedDependencies()
1605+
diags = diags.Append(lDiags)
1606+
if lDiags.HasErrors() {
16071607
return nil, diags
16081608
}
16091609

1610-
// TODO(SarahFrench/radeksimko): Use locks from here in opts below
1611-
_, lDiags := m.lockedDependencies()
1612-
diags = diags.Append(lDiags)
1613-
if lDiags.HasErrors() {
1610+
factory, fDiags := m.GetStateStoreProviderFactory(root.StateStore, locks)
1611+
diags = diags.Append(fDiags)
1612+
if fDiags.HasErrors() {
16141613
return nil, diags
16151614
}
16161615

0 commit comments

Comments
 (0)