helm-unittest icon indicating copy to clipboard operation
helm-unittest copied to clipboard

[question] Is that possible to assert two paths?

Open Sam-Tymoshchuk opened this issue 2 years ago • 1 comments

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

Sam-Tymoshchuk avatar Aug 12 '22 13:08 Sam-Tymoshchuk

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.

d3adb5 avatar Aug 21 '22 17:08 d3adb5