(inv *serpent.Invocation)
| 355 | } |
| 356 | |
| 357 | func (pf *templateUploadFlags) checkForLockfile(inv *serpent.Invocation) error { |
| 358 | if pf.stdin(inv) || pf.ignoreLockfile { |
| 359 | // Just assume there's a lockfile if reading from stdin. |
| 360 | return nil |
| 361 | } |
| 362 | |
| 363 | hasLockfile, err := provisionersdk.DirHasLockfile(pf.directory) |
| 364 | if err != nil { |
| 365 | return xerrors.Errorf("dir has lockfile: %w", err) |
| 366 | } |
| 367 | |
| 368 | if !hasLockfile { |
| 369 | cliui.Warn(inv.Stdout, "No .terraform.lock.hcl file found", |
| 370 | "When provisioning, Coder will be unable to cache providers without a lockfile and must download them from the internet each time.", |
| 371 | "Create one by running "+pretty.Sprint(cliui.DefaultStyles.Code, "terraform init")+" in your template directory.", |
| 372 | ) |
| 373 | } |
| 374 | return nil |
| 375 | } |
| 376 | |
| 377 | func (pf *templateUploadFlags) templateMessage(inv *serpent.Invocation) string { |
| 378 | title := strings.SplitN(pf.message, "\n", 2)[0] |
no test coverage detected