Background: I want to verify default labels on Kubernetes resources. They also contain "helm.sh/chart": "{{ .Chart.Name }}-{{ .Chart.Version }}" which contains the name of the chart and it's version.
I could write a test like the one below which checks for the current chart version:
That would not be very practical as the tests would need to be adjusted for every version of the chart.
I could of course check each label individually, but that would be quite some repetition.
Is it somehow possible to override the chart version in a unit test to provide a fixed value or is there a better approach?
Background: I want to verify default labels on Kubernetes resources. They also contain
"helm.sh/chart": "{{ .Chart.Name }}-{{ .Chart.Version }}"
which contains the name of the chart and it's version.I could write a test like the one below which checks for the current chart version:
That would not be very practical as the tests would need to be adjusted for every version of the chart.
I could of course check each label individually, but that would be quite some repetition. Is it somehow possible to override the chart version in a unit test to provide a fixed value or is there a better approach?