From 82814071bfcafead6e73ccd6c37da09e07c1db88 Mon Sep 17 00:00:00 2001 From: Alvaro Romero Date: Wed, 31 May 2023 17:35:45 +0200 Subject: [PATCH] Enable the use of non-csi HPP in testing lanes This commit modifies several scripts to allow the usage of classic HPP as the default SC in tests. This allows us to test our non-populator flow with a non-csi provisioner. Signed-off-by: Alvaro Romero --- automation/non-csi-hpp.sh | 25 +++++++++++++++++++++++++ cluster-sync/ephemeral_provider.sh | 13 ++++++++++++- cluster-sync/kubevirtci/provider.sh | 6 +++++- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 automation/non-csi-hpp.sh diff --git a/automation/non-csi-hpp.sh b/automation/non-csi-hpp.sh new file mode 100644 index 0000000000..13947f67b4 --- /dev/null +++ b/automation/non-csi-hpp.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# +# This file is part of the KubeVirt project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Copyright 2023 Red Hat, Inc. +# + +set -ex +export TARGET=k8s-1.26-centos9 +export KUBEVIRT_STORAGE=hpp +export HPP_CLASSIC=true +export CDI_E2E_SKIP=Destructive +automation/test.sh diff --git a/cluster-sync/ephemeral_provider.sh b/cluster-sync/ephemeral_provider.sh index 927a976b02..afd4665fd4 100644 --- a/cluster-sync/ephemeral_provider.sh +++ b/cluster-sync/ephemeral_provider.sh @@ -57,7 +57,18 @@ function configure_hpp() { _kubectl apply -f https://github.com/kubevirt/hostpath-provisioner-operator/releases/download/$HPP_RELEASE/storageclass-wffc-legacy-csi.yaml echo "Waiting for hostpath provisioner to be available" _kubectl wait hostpathprovisioners.hostpathprovisioner.kubevirt.io/hostpath-provisioner --for=condition=Available --timeout=480s - _kubectl patch storageclass hostpath-csi -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' +} + +function configure_hpp_classic() { + # Configure hpp and default to classic non-csi hostpath-provisioner + configure_hpp + _kubectl patch storageclass hostpath-provisioner -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' +} + +function configure_hpp_csi() { + # Configure hpp and default to hostpath-csi + configure_hpp + _kubectl patch storageclass hostpath-csi -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' } function configure_nfs() { diff --git a/cluster-sync/kubevirtci/provider.sh b/cluster-sync/kubevirtci/provider.sh index aec0b15113..81299b6fb0 100644 --- a/cluster-sync/kubevirtci/provider.sh +++ b/cluster-sync/kubevirtci/provider.sh @@ -22,7 +22,11 @@ function configure_storage() { fi elif [[ $KUBEVIRT_STORAGE == "hpp" ]] ; then echo "Installing hostpath provisioner storage" - configure_hpp + if [[ $HPP_CLASSIC == "true" ]] ; then + configure_hpp_classic + else + configure_hpp_csi + fi elif [[ $KUBEVIRT_STORAGE == "nfs" ]] ; then echo "Installing NFS CSI dynamic storage" configure_nfs_csi