Skip to content

Commit f4eee7c

Browse files
committed
fix: copilot issues
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
1 parent c2a1042 commit f4eee7c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,8 +2487,11 @@ func (p *CloudCustodianPlugin) Eval(req *proto.EvalRequest, apiHelper runner.Api
24872487
continue
24882488
}
24892489
baselineName := fmt.Sprintf("inventory-%s", sanitizeIdentifier(resourceType))
2490-
executionDiagnostics = append(executionDiagnostics, newExecutionDiagnostic(baselineName, resourceType, true, baseline.Execution, baseline.Err != nil))
2491-
if baseline.Err != nil || len(baseline.Execution.DiagnosticWarnings) == 0 {
2490+
// A baseline with only diagnostic warnings (e.g. unreachable endpoints)
2491+
// is still treated as a failure below, so reflect that in had_error.
2492+
baselineHadWarnings := len(baseline.Execution.DiagnosticWarnings) > 0
2493+
executionDiagnostics = append(executionDiagnostics, newExecutionDiagnostic(baselineName, resourceType, true, baseline.Execution, baseline.Err != nil || baselineHadWarnings))
2494+
if baseline.Err != nil || !baselineHadWarnings {
24922495
continue
24932496
}
24942497
err := formatExecutionDiagnosticWarnings(baseline.Execution.DiagnosticWarnings)

0 commit comments

Comments
 (0)