Skip to content

Commit

Permalink
fixup! Security Mode: E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleoli committed Oct 23, 2023
1 parent df224e0 commit 084e8f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions test/e2e/pipeline/installer/liqoctl/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions test/e2e/testconsts/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/testutils/tester/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
Expand Down Expand Up @@ -103,13 +105,15 @@ 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()

tester = &Tester{
Namespace: namespace,
OverlappingCIDRs: strings.EqualFold(overlappingCIDRsString, "true"),
SecurityMode: consts.SecurityModeType(securityModeString),
}

tester.ClustersNumber, err = getClusterNumberFromEnv()
Expand Down

0 comments on commit 084e8f6

Please sign in to comment.