Skip to content

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
kmoe committed Jan 28, 2022
1 parent 24cb30e commit 213b6e0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tfexec/exit_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ var (
`Error: Could not satisfy plugin requirements|` +
`Error: Could not load plugin|` + // v0.13
`Please run \"terraform init\"|` + // v1.1.0 early alpha versions (ref 89b05050)
`run:\s+terraform init` + // v1.1.0 (ref df578afd)
`run:\s+terraform init|` + // v1.1.0 (ref df578afd)
`Run\s+\"terraform init\"|` + // v1.2.0

// UNINITIALISED BACKENDS
`Error: Initialization required.|` + // v0.13
`Error: Backend initialization required, please run \"terraform init\"|`, // v0.15
`Error: Backend initialization required, please run \"terraform init\"`, // v0.15
)

noConfigErrRegexp = regexp.MustCompile(`Error: No configuration files`)
Expand All @@ -42,7 +43,9 @@ var (

stateLockErrRegexp = regexp.MustCompile(`Error acquiring the state lock`)
stateLockInfoRegexp = regexp.MustCompile(`Lock Info:\n\s*ID:\s*([^\n]+)\n\s*Path:\s*([^\n]+)\n\s*Operation:\s*([^\n]+)\n\s*Who:\s*([^\n]+)\n\s*Version:\s*([^\n]+)\n\s*Created:\s*([^\n]+)\n`)
statePlanReadErrRegexp = regexp.MustCompile(`Terraform couldn't read the given file as a state or plan file.|Error: Failed to read the given file as a state or plan file`)
statePlanReadErrRegexp = regexp.MustCompile(
`Terraform couldn't read the given file as a state or plan file.|` +
`Error: Failed to read the given file as a state or plan file`)
)

func (tf *Terraform) wrapExitError(ctx context.Context, err error, stderr string) error {
Expand Down

0 comments on commit 213b6e0

Please sign in to comment.