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
6666 return depsfile .SaveLocksToFile (new , dependencyLockFilename )
6767}
6868
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.
7176// This allows code in the init command to download providers in separate phases and
7277// keep the lock file updated accurately after each phase.
7378//
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 .
7681func (m * Meta ) mergeLockedDependencies (baseLocks , additionalLocks * depsfile.Locks ) * depsfile.Locks {
7782
7883 mergedLocks := baseLocks .DeepCopy ()
You can’t perform that action at this time.
0 commit comments