terraform/internal/depsfile
Masayuki Morita 31a5aa1878
command/init: Add a new flag `-lockfile=readonly` (#27630)
Fixes #27506

Add a new flag `-lockfile=readonly` to `terraform init`.
It would be useful to allow us to suppress dependency lockfile changes
explicitly.

The type of the `-lockfile` flag is string rather than bool, leaving
room for future extensions to other behavior variants.

The readonly mode suppresses lockfile changes, but should verify
checksums against the information already recorded. It should conflict
with the `-upgrade` flag.

Note: In the original use-case described in #27506, I would like to
suppress adding zh hashes, but a test code here suppresses adding h1
hashes because it's easy for testing.

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>
2021-03-09 11:12:00 -05:00
..
testdata/locks-files depsfile: Flatten the "hashes" locks to a single set of strings 2020-09-24 14:01:54 -07:00
doc.go internal/depsfile: Loading locks from HCL files on disk 2020-09-08 09:50:58 -07:00
locks.go command/init: Add a new flag `-lockfile=readonly` (#27630) 2021-03-09 11:12:00 -05:00
locks_file.go fix file mode on lock file (#27205) 2020-12-18 11:51:59 -05:00
locks_file_test.go fix file mode on lock file (#27205) 2020-12-18 11:51:59 -05:00
locks_test.go command/init: Add a new flag `-lockfile=readonly` (#27630) 2021-03-09 11:12:00 -05:00
paths.go internal/depsfile: Loading locks from HCL files on disk 2020-09-08 09:50:58 -07:00
testing.go command/init: Read, respect, and update provider dependency locks 2020-10-09 09:26:23 -07:00