Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new status when there is no change in the plan #728

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions configstack/stack_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,16 @@ func warnAboutMissingDependencies(module TerraformModule, output string) {

// Parse the output message to extract a summary
func extractSummaryResultFromPlan(output string) planSummary {
const noChangeV012 = "No changes. Infrastructure is up-to-date."
const noChangeV013 = "Plan: 0 to add, 0 to change, 0 to destroy."
const noChangeV102 = "Your infrastructure matches the configuration."
if strings.Contains(output, noChangeV012) || strings.Contains(output, noChangeV013) || strings.Contains(output, noChangeV102) {
return planSummary{"No change", 0, true}
noChanges := []string{
"Plan: 0 to add, 0 to change, 0 to destroy.", // This was the message returned by terraform 0.11
"No changes. Infrastructure is up-to-date.", // This was the message returned by terraform 0.12
"Your infrastructure matches the configuration.",
"without changing any real infrastructure.",
}
for _, noChange := range noChanges {
if strings.Contains(output, noChange) {
return planSummary{"No change", 0, true}
}
}

result := planResultRegex.FindStringSubmatch(output)
Expand Down
Loading