Skip to content

Commit

Permalink
Add an explanation about the readonly mode
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Mar 8, 2021
1 parent f7953e8 commit e1af3d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions command/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (c *InitCommand) Run(args []string) int {
cmdFlags.BoolVar(&c.reconfigure, "reconfigure", false, "reconfigure")
cmdFlags.BoolVar(&flagUpgrade, "upgrade", false, "")
cmdFlags.Var(&flagPluginPath, "plugin-dir", "plugin directory")
cmdFlags.StringVar(&flagLockfile, "lockfile", "", "Set dependency lockfile mode")
cmdFlags.StringVar(&flagLockfile, "lockfile", "", "Set a dependency lockfile mode")
cmdFlags.Usage = func() { c.Ui.Error(c.Help()) }
if err := cmdFlags.Parse(args); err != nil {
return 1
Expand Down Expand Up @@ -989,7 +989,7 @@ Options:
previously-downloaded objects and install the
latest version allowed within configured constraints.
-lockfile=MODE Set dependency lockfile mode.
-lockfile=MODE Set a dependency lockfile mode.
Currently only "readonly" is valid.
`
Expand Down
9 changes: 8 additions & 1 deletion website/docs/cli/commands/init.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ You can modify `terraform init`'s plugin behavior with the following options:
You can use `-plugin-dir` as a one-time override for exceptional situations,
such as if you are testing a local build of a provider plugin you are
currently developing.
- `-lockfile=MODE` Set dependency lockfile mode. Currently only "readonly" is valid.
- `-lockfile=MODE` Set a dependency lockfile mode.

The valid values for the lockfile mode are as follows:

- readonly: suppress the lockfile changes, but verify checksums against the
information already recorded. It conflicts with the `-upgrade` flag. If you
update the lockfile with third-party dependency management tools, it would be
useful to control when it changes explicitly.

## Running `terraform init` in automation

Expand Down

0 comments on commit e1af3d6

Please sign in to comment.