Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 e2e tests: make the management cluster Kubernetes version configurable #5081

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (

// Test suite constants for e2e config variables.
const (
ManagementClusterImage = "MANAGEMENT_CLUSTER_IMAGE"
sbueringer marked this conversation as resolved.
Show resolved Hide resolved
KubernetesVersion = "KUBERNETES_VERSION"
CNIPath = "CNI"
CNIResources = "CNI_RESOURCES"
Expand Down
1 change: 1 addition & 0 deletions test/e2e/config/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ providers:
variables:
# default variables for the e2e test; those values could be overridden via env variables, thus
# allowing the same e2e config file to be re-used in different prow jobs e.g. each one with a K8s version permutation
MANAGEMENT_CLUSTER_IMAGE: "kindest/node:v1.22.0"
KUBERNETES_VERSION: "v1.22.0"
ETCD_VERSION_UPGRADE_TO: "3.5.0-0"
COREDNS_VERSION_UPGRADE_TO: "1.8.4"
Expand Down
1 change: 1 addition & 0 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func setupBootstrapCluster(config *clusterctl.E2EConfig, scheme *runtime.Scheme,
if !useExistingCluster {
clusterProvider = bootstrap.CreateKindBootstrapClusterAndLoadImages(ctx, bootstrap.CreateKindBootstrapClusterAndLoadImagesInput{
Name: config.ManagementClusterName,
Image: config.GetVariable(ManagementClusterImage),
RequiresDockerSock: config.HasDockerProvider(),
Images: config.Images,
IPFamily: config.GetVariable(IPFamily),
Expand Down
12 changes: 9 additions & 3 deletions test/framework/bootstrap/kind_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ import (

// CreateKindBootstrapClusterAndLoadImagesInput is the input for CreateKindBootstrapClusterAndLoadImages.
type CreateKindBootstrapClusterAndLoadImagesInput struct {
// Name of the cluster
// Name of the cluster.
Name string

// RequiresDockerSock defines if the cluster requires the docker sock
// Image of the cluster.
Image string

// RequiresDockerSock defines if the cluster requires the docker sock.
RequiresDockerSock bool

// Images to be loaded in the cluster (this is kind specific)
// Images to be loaded in the cluster.
Images []clusterctl.ContainerImage

// IPFamily is either ipv4 or ipv6. Default is ipv4.
Expand All @@ -55,6 +58,9 @@ func CreateKindBootstrapClusterAndLoadImages(ctx context.Context, input CreateKi
log.Logf("Creating a kind cluster with name %q", input.Name)

options := []KindClusterOption{}
if input.Image != "" {
options = append(options, WithNodeImage(input.Image))
}
if input.RequiresDockerSock {
options = append(options, WithDockerSockMount())
}
Expand Down