You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Undefined JSONPath expressions produce nil silently — hard to debug #12
When a JSONPath expression in a pipeline resolves to nothing (undefined field, typo), GetJSONPathRaw returns (nil, nil) by design. This is needed for @definedOr to work. But in @project context, nil values flow into the output object silently:
Critical fields (metadata.name/namespace): K8s rejects the object with a confusing error like "metadata/namespace must be a string (current value nil)" — no indication which expression failed
Non-critical fields (labels, config values, resources): silently null in the output, no error anywhere
Example
# Typo: $.MatrixRTCStack.metadata.namespace in a single-source pipeline# (should be $.metadata.namespace — single-source doesn't use Kind prefix)metadata:
namespace: "$.MatrixRTCStack.metadata.namespace"
Error at runtime: invalid object: metadata/namespace must be a string (current value nil)
The actual cause (wrong JSONPath convention) is not visible in any log or event.
Root Cause
pkg/expression/jsonpath.go:108-111 — error return deliberately commented out, replaced with return nil, nil. This is correct for @definedOr (line 309 checks v == nil).
Suggestion
Add a DEBUG-level log when a JSONPath resolves to nil outside of @definedOr context, e.g.:
DEBUG expression JSONPath resolved to nil {"expression": "$.MatrixRTCStack.metadata.namespace", "context": "@project"}
This preserves backward compatibility and @definedOr behavior while making typos visible in logs.
Activity