File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,18 @@ func (m *Meta) replaceLockedDependencies(new *depsfile.Locks) tfdiags.Diagnostic
66
66
return depsfile .SaveLocksToFile (new , dependencyLockFilename )
67
67
}
68
68
69
- // mergeLockedDependencies overwrites the existing lock file with a combination of
70
- // the old lock contents and new locks.
69
+ // mergeLockedDependencies combines two sets of locks. The 'base' locks are copied, and any providers
70
+ // present in the additional locks that aren't present in the base are added to that copy. The merged
71
+ // combination is returned.
72
+ //
73
+ // If you're combining locks derived from config with other locks (from state or deps locks file), then
74
+ // the config locks need to be the first argument to ensure that the merged locks contain any
75
+ // version constraints. Version constraint data is only present in configuration.
71
76
// This allows code in the init command to download providers in separate phases and
72
77
// keep the lock file updated accurately after each phase.
73
78
//
74
- // Any overlaps between the two sets of locks will be ignored; only new providers will
75
- // be appended .
79
+ // This method supports downloading providers in 2 steps, and is used during the second download step and
80
+ // while updating the dependency lock file .
76
81
func (m * Meta ) mergeLockedDependencies (baseLocks , additionalLocks * depsfile.Locks ) * depsfile.Locks {
77
82
78
83
mergedLocks := baseLocks .DeepCopy ()
You can’t perform that action at this time.
0 commit comments