Skip to content

Commit

Permalink
Merge pull request #352 from werf/fix/no-failure-message-if-generic-t…
Browse files Browse the repository at this point in the history
…racker-conditions-failed

fix: no failure message if generic tracker conditions failed
  • Loading branch information
ilya-lesikov authored Jan 16, 2025
2 parents 285ccc5 + b84b40e commit 5e04e7e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/tracker/generic/resource_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ func NewResourceStatus(object *unstructured.Unstructured) (*ResourceStatus, erro
return nil, fmt.Errorf("error getting resource status indicator: %w", err)
}

isFailed := resourceStatusIndicator != nil && resourceStatusIndicator.IsFailed()

var failureReason string
if isFailed {
failureReason = "Resource status field value matched failed condition."
}

return &ResourceStatus{
Indicator: resourceStatusIndicator,
isReady: resourceStatusIndicator == nil || (resourceStatusIndicator != nil && resourceStatusIndicator.IsReady()),
isFailed: resourceStatusIndicator != nil && resourceStatusIndicator.IsFailed(),
isFailed: isFailed,
humanConditionPath: humanJSONPath,
failureReason: failureReason,
}, nil
}

Expand Down

0 comments on commit 5e04e7e

Please sign in to comment.