Closed richcooper95 closed 6 months ago
Confirmed that the above is correct - with the following change:
if [ "${IS_LAST_PIPELINE}" = "true" ]; then
if [ "${current_message}" = "Pending" ]; then
- status="$(yq -n '.message = "Resource requested"')"
+ status=$(echo "$status" | yq '.message = "Resource requested"')
fi
fi
We see:
+ '[' true '=' true ]
+ '[' Pending '=' Pending ]
+ echo 'conditions:
- lastTransitionTime: "2024-05-09T16:55:27Z"
message: Pipeline has not completed
reason: PipelineNotCompleted
status: "False"
type: PipelineCompleted
message: Pending
complianceStatus: "compliance scan result: compliant"'
+ yq '.message = "Resource requested"'
+ status='conditions: <<<<< Not overwritten
- lastTransitionTime: "2024-05-09T16:55:27Z"
message: Pipeline has not completed
reason: PipelineNotCompleted
status: "False"
type: PipelineCompleted
message: Resource requested
complianceStatus: "compliance scan result: compliant"'
When updating the status in a Pipeline via
/kratix/metadata/status.yaml
, the result is only updated in k8s if themessage
has been updated.Otherwise, the new key-values aren't populated into the resource status.
Investigation
The
status-writer
looks to be overwriting the status fromstatus.yaml
here:See example logs:
Examples
Without an update to
message
The
status-writer
picks up the newcomplianceStatus
key-value:But doesn't populate this into the resource status:
With an update to
message
The resource status picks up the change: