diff --git a/test/e2e/pipeline/installer/liqoctl/setup.sh b/test/e2e/pipeline/installer/liqoctl/setup.sh index c942556354..c55d820014 100755 --- a/test/e2e/pipeline/installer/liqoctl/setup.sh +++ b/test/e2e/pipeline/installer/liqoctl/setup.sh @@ -68,7 +68,7 @@ do export POD_CIDR="10.$((i * 10)).0.0/16" fi COMMON_ARGS=(--cluster-name "liqo-${i}" --local-chart-path ./deployments/liqo - --version "${LIQO_VERSION}" --set controllerManager.config.enableResourceEnforcement=true) + --version "${LIQO_VERSION}" --set controllerManager.config.enableResourceEnforcement=true --set "networking.securityMode=${SECURITY_MODE}") if [[ "${CLUSTER_LABELS}" != "" ]]; then COMMON_ARGS=("${COMMON_ARGS[@]}" --cluster-labels "${CLUSTER_LABELS}") fi @@ -81,8 +81,6 @@ do else LIQO_PROVIDER="${INFRA}" fi -COMMON_ARGS=("${COMMON_ARGS[@]}" --set "networking.securityMode=${SECURITY_MODE}") - if [ "${i}" == "1" ]; then # Install Liqo with Helm, to check that values generation works correctly. diff --git a/test/e2e/testconsts/consts.go b/test/e2e/testconsts/consts.go index 8bb482b950..2c61f0684b 100644 --- a/test/e2e/testconsts/consts.go +++ b/test/e2e/testconsts/consts.go @@ -20,6 +20,7 @@ const ( ClusterNumberVarKey = "CLUSTER_NUMBER" KubeconfigDirVarName = "KUBECONFIGDIR" OverlappingCIDRsEnvVar = "POD_CIDR_OVERLAPPING" + SecurityModeEnvVar = "SECURITY_MODE" ) // LiqoTestNamespaceLabels is a set of labels that has to be attached to test namespaces to simplify garbage collection. diff --git a/test/e2e/testutils/tester/tester.go b/test/e2e/testutils/tester/tester.go index b26bf2c044..184171af32 100644 --- a/test/e2e/testutils/tester/tester.go +++ b/test/e2e/testutils/tester/tester.go @@ -34,6 +34,7 @@ import ( offv1alpha1 "github.com/liqotech/liqo/apis/offloading/v1alpha1" sharingv1alpha1 "github.com/liqotech/liqo/apis/sharing/v1alpha1" virtualKubeletv1alpha1 "github.com/liqotech/liqo/apis/virtualkubelet/v1alpha1" + "github.com/liqotech/liqo/pkg/consts" "github.com/liqotech/liqo/pkg/utils" "github.com/liqotech/liqo/test/e2e/testconsts" testutils "github.com/liqotech/liqo/test/e2e/testutils/util" @@ -46,6 +47,7 @@ type Tester struct { // ClustersNumber represents the number of available clusters ClustersNumber int OverlappingCIDRs bool + SecurityMode consts.SecurityModeType } // ClusterContext encapsulate all information and objects used to access a test cluster. @@ -103,6 +105,7 @@ func createTester(ctx context.Context, ignoreClusterIDError bool) (*Tester, erro TmpDir := testutils.GetEnvironmentVariableOrDie(testconsts.KubeconfigDirVarName) overlappingCIDRsString := testutils.GetEnvironmentVariableOrDie(testconsts.OverlappingCIDRsEnvVar) + securityModeString := testutils.GetEnvironmentVariableOrDie(testconsts.SecurityModeEnvVar) // Here is necessary to add the controller runtime clients. scheme := getScheme() @@ -110,6 +113,7 @@ func createTester(ctx context.Context, ignoreClusterIDError bool) (*Tester, erro tester = &Tester{ Namespace: namespace, OverlappingCIDRs: strings.EqualFold(overlappingCIDRsString, "true"), + SecurityMode: consts.SecurityModeType(securityModeString), } tester.ClustersNumber, err = getClusterNumberFromEnv()