sylva-units: rework and add test-values to test upgrades for both mgmt and workload, on both cabpr and cabpk
This MR improves the sylva-units test unit tools and test suite to ensure that we test the "is_upgrade" case for both management and workload-cluster, and for both kubeadm and RKE2.
The motivation, besides just having a better test coverage is that is is frequent to hit issues related to dependencies when developing on workload-cluster.values.yaml and/or dependencies that differ during an upgrade and/or that differ depending on the CAPI bootstrap provider.
This evolution will allow to easily catch this kind of error.
Example:
$ tools/validation/helm-template-yamllint.sh sylva-units upgrade-*
--------------- Checking values from test-values/upgrade-workload-cabpr with 'helm template ' and 'yamllint' ...
running: helm template sylva-units charts/sylva-units --values charts/sylva-units/test-values/upgrade-workload-cabpr/00-upgrade.yaml --values charts/sylva-units/test-values/upgrade-workload-cabpr/01-cabpr.yaml --values charts/sylva-units/test-values/upgrade-workload-cabpr/02-workload-cluster.values.yaml --values charts/sylva-units/test-values/upgrade-workload-cabpr/shared-settings-mock.values.yaml
Error: execution error at (sylva-units/templates/units.yaml:39:10): unit calico is involved in a circular dependency:
[calico-crd calico-rke2-chart-cleanup cluster-prevent-rke2-helmcharts-calico-metallb kyverno mgmt-cluster-ready root-dependency monitoring-crd calico-ready calico cluster-reachable namespace-defs rke2-helmchart-prevent-uninstall]
Use --debug flag to render out invalid YAML
Failure when running 'helm template ..| yamllint ..' on this test case.
What this MR does:
- rework test values to move things common to upgrades and check-immutability
- add test-values for upgrades:
- both kubeadm and RKE2
- both mgmt and workload
- improve
tools/validation/helm-template-yamllint.sh:- allow running selected test values (e.g. "tools/validation/helm-template-yamllint.sh sylva-units capo*")
- display the helm template command line that is run
- don't display complete directory names
- remove obsolete code related to unused '.release-is-upgrade'
Edited by Thomas Morin