diff --git a/pkg/terraform/parser.go b/pkg/terraform/parser.go index 892a62be..72a30aab 100644 --- a/pkg/terraform/parser.go +++ b/pkg/terraform/parser.go @@ -104,7 +104,7 @@ func extractMovedResource(pattern *regexp.Regexp, line string) *MovedResource { } // Parse returns ParseResult related with terraform plan -func (p *PlanParser) Parse(body string) ParseResult { //nolint:cyclop +func (p *PlanParser) Parse(body string) ParseResult { //nolint:cyclop,maintidx switch { case p.Fail.MatchString(body): case p.Pass.MatchString(body) || p.OutputsChanges.MatchString(body): @@ -128,13 +128,13 @@ func (p *PlanParser) Parse(body string) ParseResult { //nolint:cyclop endWarning := -1 startErrorIndex := -1 for i, line := range lines { - if line == "Note: Objects have changed outside of Terraform" { // https://github.com/hashicorp/terraform/blob/332045a4e4b1d256c45f98aac74e31102ace7af7/internal/command/views/plan.go#L403 + if line == "Note: Objects have changed outside of Terraform" || line == "Note: Objects have changed outside of OpenTofu" { // https://github.com/hashicorp/terraform/blob/332045a4e4b1d256c45f98aac74e31102ace7af7/internal/command/views/plan.go#L403 startOutsideTerraform = i + 1 } if startOutsideTerraform != -1 && endOutsideTerraform == -1 && strings.HasPrefix(line, "Unless you have made equivalent changes to your configuration") { // https://github.com/hashicorp/terraform/blob/332045a4e4b1d256c45f98aac74e31102ace7af7/internal/command/views/plan.go#L110 endOutsideTerraform = i + 1 } - if line == "Terraform will perform the following actions:" { // https://github.com/hashicorp/terraform/blob/332045a4e4b1d256c45f98aac74e31102ace7af7/internal/command/views/plan.go#L252 + if line == "Terraform will perform the following actions:" || line == "OpenTofu will perform the following actions:" { // https://github.com/hashicorp/terraform/blob/332045a4e4b1d256c45f98aac74e31102ace7af7/internal/command/views/plan.go#L252 startChangeOutput = i + 1 } // If we have output changes but not resource changes, Terraform