Validating a Harness Expression


Trigger does not validate if the required artifact’s inputs exists. This happens when using a StatefulSet image in Kubernetes and the StatefulSet gets stuck, resulting in the user deleting the pod manually to try to redeploy.


Use a validation as a shell script step that would fail when it doesn’t evaluate:

export skip="false"


if [ '${k8s.workload}' = $match ]; then


This happens when expression does not resolve to a value. In those cases, Harness will leave the syntax as-is. This is necessary for cases when a Harness expression could represent a valid expression in a script or YAML file. A force failure could break things that appear like a Harness expression but are not.

In the case above, ${k8s.workload} is missing so it evaluates to nothing, and so we leave the string intact as it was.

1 Like