mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
This adds JSONPath support to the json compare analyzer using k8s.io/client-go/util/jsonpath implementation. To preserve backwards compatibility a new attribute, `JsonPath, is added to the compare analyzer as opposed to changing how `Path` works. Only one should be set, but preference is given to `Path`, again to maintain backwards compatibility. As a convience for users, if the result of running the JSONPath expression returns a single value, that value is unwrapped from its enclosing array and used as the comparison with `Value`. This isn't strictly compatible with how JSONPath works (all results are wrapped in an array), but it's easier for end users who are expecting a single result from their JSONPath expression.