Skip to content

Commit c769468

Browse files
NETIZEN-11NETIZEN-11
authored andcommitted
Fix: Update go.mod and result classification logic
- Update go.mod: k8s.io/apiextensions-apiserver already at v0.35.0 - Add YAML tags to RenderStatus, PipelineStepResult, ResultItem structs - Fix result classification logic to use severity instead of ExitCode - Fix test YAML parsing with proper multiline format - Add strings import for severity normalization Signed-off-by: NETIZEN-11 <[email protected]> Signed-off-by: NETIZEN-11 <[email protected]>
1 parent 1f3f81f commit c769468

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

internal/util/render/executor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,9 @@ func extractResultsFromFnResults(fnResults *fnresult.ResultList) ([]kptfilev1.Re
392392
// Process the Results field which contains framework.Results
393393
for _, result := range item.Results {
394394
message := result.Message
395-
severity := string(result.Severity) // Convert framework.Severity to string
395+
severity := strings.ToLower(strings.TrimSpace(string(result.Severity))) // Normalize and convert framework.Severity to string
396396

397-
// Default severity if not specified
397+
// Default severity if not specified: infer from function exit code
398398
if severity == "" {
399399
if item.ExitCode == 0 {
400400
severity = "info"
@@ -405,7 +405,7 @@ func extractResultsFromFnResults(fnResults *fnresult.ResultList) ([]kptfilev1.Re
405405

406406
resultItem := createResultItem(nil, message, severity)
407407

408-
// Classify based on severity instead of ExitCode
408+
// Classify results based on per-result severity, not function exit code
409409
if severity == "error" {
410410
errorResults = append(errorResults, resultItem)
411411
} else {

0 commit comments

Comments
 (0)