Skip to content

Commit

Permalink
Adds CSI rocks to the integration test (#9)
Browse files Browse the repository at this point in the history
The CSI images required by Longhorn are on a separate repository, as
they are common for any CSI storage provider.
  • Loading branch information
claudiubelu authored Sep 10, 2024
1 parent e1e3807 commit a8f0bb3
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions tests/integration/test_longhorn_in_helm_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,22 @@
"longhorn-share-manager": "longhorn.shareManager",
"backing-image-manager": "longhorn.backingImageManager",
"support-bundle-kit": "longhorn.supportBundleKit",
"csi-attacher": "csi.attacher",
"csi-provisioner": "csi.provisioner",
"csi-node-driver-registrar": "csi.nodeDriverRegistrar",
"csi-resizer": "csi.resizer",
"csi-snapshotter": "csi.snapshotter",
"livenessprobe": "csi.livenessProbe",
"openshift-origin-oauth-proxy": "openshift.oauthProxy",
}

LONGHORN_CSI_IMAGES_VERSION_MAP = {
# https://github.com/longhorn/longhorn/releases/download/v1.7.0/longhorn-images.txt
"v1.7.0": {
# helm image subsection: image
"csi.attacher": "ghcr.io/canonical/csi-attacher:4.6.1-ck5",
"csi.provisioner": "ghcr.io/canonical/csi-provisioner:4.0.1-ck4",
"csi.nodeDriverRegistrar": "ghcr.io/canonical/csi-node-driver-registrar:2.11.1-ck3",
"csi.resizer": "ghcr.io/canonical/csi-resizer:1.11.1-ck1",
"csi.snapshotter": "ghcr.io/canonical/csi-snapshotter:7.0.2-ck2",
"csi.livenessProbe": "ghcr.io/canonical/livenessprobe:2.13.1-ck0",
},
}


def _wait_for_node_annotation(instance, annotation, value):
escaped_annotation = annotation.translate(str.maketrans({".": "\\.", "/": "\\/"}))
Expand Down Expand Up @@ -121,17 +128,14 @@ def test_longhorn_helm_chart_deployment(
)
found_env_rocks_metadata.append(rmi.name)

helm_command = [
"sudo",
"k8s",
"helm",
"install",
INSTALL_NAME,
CHART_RELEASE_URL,
"--namespace",
INSTALL_NS,
"--create-namespace",
images = [
k8s_util.HelmImage(image, subitem=subsection)
for subsection, image in LONGHORN_CSI_IMAGES_VERSION_MAP[image_version].items()
]

helm_command = k8s_util.get_helm_install_command(
INSTALL_NAME, CHART_RELEASE_URL, INSTALL_NS, images=images
)
helm_command.extend(all_chart_value_overrides_args)

function_instance.exec(helm_command)
Expand Down

0 comments on commit a8f0bb3

Please sign in to comment.