Skip to content
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,21 @@ post:
- type: "Health"
status:
expression: |
adapter.?executionStatus.orValue("") == "success" ? "True" : "False"
adapter.?executionStatus.orValue("") == "success"
&& !(adapter.?resourcesSkipped.orValue(false) && adapter.?errorReason.orValue("") != "")
? "True" : "False"
reason:
expression: |
adapter.?errorReason.orValue("") != "" ? adapter.?errorReason.orValue("") : "Healthy"
adapter.?executionStatus.orValue("") != "success"
? "ExecutionFailed"
: adapter.?errorReason.orValue("") != ""
? adapter.?errorReason.orValue("")
: "Healthy"
message:
expression: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Category: Bug

The message.expression doesn't account for the new ExecutionFailed reason path. When
executionStatus != "success" and errorMessage is empty, the message defaults to "All adapter operations completed successfully" — which contradicts the "False" status and
"ExecutionFailed" reason.

The cl-maestro adapter config already handles this with a 3-way ternary. Consider matching
that pattern:

message:
  expression: |
    adapter.?executionStatus.orValue("") != "success"
      ? adapter.?errorMessage.orValue("Adapter execution failed")
      : adapter.?errorMessage.orValue("") != ""
        ? adapter.?errorMessage.orValue("")
        : "All adapter operations completed successfully"

This way, execution failures always get a meaningful message even if errorMessage is empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

adapter.?errorMessage.orValue("") != "" ? adapter.?errorMessage.orValue("") : "All adapter operations completed successfully"
adapter.?errorMessage.orValue("") != ""
? adapter.?errorMessage.orValue("")
: "All adapter operations completed successfully"
observed_generation:
expression: "1"
observed_time: "{{ now | date \"2006-01-02T15:04:05Z07:00\" }}"
Expand Down