This commit introduces a check to determine whether or not the
csi-snapshotter container will be created in each provisioner's
pod.
The only scenario in which the 'provisioner.snapshotter.enabled'
field will automatically be set to 'true' and the csi-snapshotter
container will be created during apply is with:
- CRDs created: volumesnapshotclasses, volumesnapshots and
volumesnapshotcontents.
- Snapshot-controller pod created and using the correct image
according to the K8s version.
In all other scenarios, 'provisioner.snapshotter.enabled' will be
set to 'false' during apply and the container will not be created.
Remembering that the user can create/remove the container manually
if desired via helm override.
Depends-on: https://review.opendev.org/c/starlingx/platform-armada-app/+/904875
Test Plan:
PASS: Build a new app package with the code changes
PASS: Successfully execute upload, apply, remove, and delete
operations for platform-integ-apps
PASS: In an environment with CRDs and snapshot-controller using
the correct image version according to Kubernetes, apply the
app and verify that the snaphotter field is 'enabled: true'
and the container has been created in both provisioner pods
PASS: In an environment with CRDs but with snapshot-controller
using the incorrect image version according to Kubernetes,
apply the app and verify that the snaphotter field is
'enabled: false' and the container has not been created
PASS: In an environment without CRDs and snapshot-controller, apply
the app and verify that snaphotter field is 'enabled: false'
and the container has not been created
PASS: Manually create/remove csi-snapshotter container via
helm-override
Partial-Bug: 2045897
Change-Id: I7dbcbba520c9758de84e8dae5a553ec1fee69518
Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>