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] Is that possible to assert two paths? #171

Open Sam-Tymoshchuk opened 2 years ago

Sam-Tymoshchuk commented 2 years ago

I would like to compare that sa created in a dependency chart is what set to serviceAccountName in my deployment?

d3adb5 commented 2 years ago

Might be a good idea to enable the Discussion tab for this kind of issue, @quintush.

@Sam-Tymoshchuk As far as I can tell, no it isn't possible. It would mean referencing something within another rendered object, which isn't part of this library. Might be an interesting feature to add, however, as often we don't care too much about testing the templating logic as much as we do testing an object is the one referenced.

That said, if there is any logic in the service account name template, and you can test that, you could add an equality test for both the ServiceAccount's metadata.name and the Deployment's spec.serviceAccountName.