quintush / helm-unittest

BDD styled unit test framework for Kubernetes Helm charts as a Helm plugin.
MIT License
345 stars 69 forks source link

[question] how can I perform hasKey to check path exists? #211

Open asfaltboy opened 1 year ago

asfaltboy commented 1 year ago

I'm looking to check the existance of a path (hasKey), and the fact that it does not exist (e.g hasNotKey).

For context: it is similar to the contains flag, but for maps rather than arrays.

Use case: it's pretty common to use a switch between two options based on a value, e.g choose one of two annotations per container runtime.

Note: I tried using matchRegex with the .* pattern, but the validator complains that it's an unknown path.

Appologies if there is already a way to do this, I tried my best to read through the docs and the issues, but could not find an answer to this question