Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
- name: Run e2e test
run: |
export AWS_B64ENCODED_CREDENTIALS=$(clusterawsadm bootstrap credentials encode-as-profile)
make e2e TEST_NAME="${{ matrix.e2e-suite }}" E2E_CONF_FILE="$(pwd)/e2e/config/aws.yaml"
make e2e-aws TEST_NAME="${{ matrix.e2e-suite }}"

- name: Archive artifacts
if: failure()
Expand Down
20 changes: 1 addition & 19 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,6 @@ jobs:
run: |
make -C inttest ${{ matrix.smoke-suite }}


capi-smokes-on-different-k0s-versions:
name: CAPI Smokes Matrix
needs: [build, unittest]
strategy:
fail-fast: false
matrix:
smoke-suite:
- check-capi-remote-machine
- check-capi-remote-machine-template
k0s-version: [ "v1.28.11", "v1.29.6", "v1.30.2" ]

uses: ./.github/workflows/capi-smoke-tests.yml
with:
smoke-suite: ${{ matrix.smoke-suite }}
k0s-version: ${{ matrix.k0s-version }}

capi-smokes:
name: Cluster API smoke tests
needs: [build, unittest]
Expand All @@ -223,7 +206,6 @@ jobs:
- check-capi-controlplane-docker-worker
- check-capi-docker-machine-change-args
- check-capi-docker-machine-change-template
- check-capi-remote-machine-template-update
- check-capi-docker-machine-template-update
- check-capi-docker-machine-template-update-recreate
- check-capi-docker-machine-template-update-recreate-single
Expand Down Expand Up @@ -285,6 +267,6 @@ jobs:
if: failure()
uses: actions/[email protected]
with:
name: e2e-artifacts
name: e2e-artifacts-${{ matrix.e2e-suite }}
path: _artifacts
if-no-files-found: ignore
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ __debug_bin*
_artifacts

# E2E test templates
e2e/data/infrastructure-docker/**/cluster-template*.yaml
e2e/data/infrastructure-docker/**/cluster-template*.yaml
e2e/data/infrastructure-k0smotron/**/cluster-template*.yaml
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
CRDOC ?= $(LOCALBIN)/crdoc

## e2e configuration
E2E_CONF_FILE ?= $(shell pwd)/e2e/config/docker.yaml
E2E_CONF_FILE ?= $(shell pwd)/e2e/config.yaml
E2E_INFRASTRUCTURE_PROVIDER ?= k0sproject-k0smotron
SKIP_RESOURCE_CLEANUP ?= false
# Artifacts folder generated for e2e tests
ARTIFACTS ?= $(shell pwd)/_artifacts
Expand Down Expand Up @@ -116,7 +117,9 @@ vet: ## Run go vet against code.
test: $(ENVTEST)
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(GO_TEST_DIRS) -run '$(TEST_NAME)' -coverprofile cover.out

## Template by infrastructure provider for e2e tests
DOCKER_TEMPLATES := e2e/data/infrastructure-docker
K0SMOTRON_TEMPLATES := e2e/data/infrastructure-k0smotron

.PHONY: generate-e2e-templates-main
generate-e2e-templates-main: $(KUSTOMIZE)
Expand All @@ -127,6 +130,14 @@ generate-e2e-templates-main: $(KUSTOMIZE)
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-machinedeployment --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-machinedeployment.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-remote-hcp --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-remote-hcp.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-ingress --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-ingress.yaml
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template.yaml
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-webhook-recreate-in-single-mode --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-webhook-recreate-in-single-mode.yaml
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-webhook-k0s-not-compatible --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-webhook-k0s-not-compatible.yaml
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-kcp-remediation --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-kcp-remediation.yaml
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-remote-hcp --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-remote-hcp.yaml
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-ingress --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-ingress.yaml
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-machinedeployment --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-machinedeployment.yaml



e2e: generate-e2e-templates-main
Expand All @@ -135,6 +146,7 @@ e2e: generate-e2e-templates-main
-artifacts-folder="$(ARTIFACTS)" \
-config="$(E2E_CONF_FILE)" \
-skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) \
-infrastructure-provider=$(E2E_INFRASTRUCTURE_PROVIDER) \
-timeout=30m

e2e-aws:
Expand All @@ -143,7 +155,7 @@ e2e-aws:
@[ -n "$$AWS_REGION" ] || (echo "AWS_REGION not defined"; exit 1)
@[ -n "$$AWS_B64ENCODED_CREDENTIALS" ] || (echo "AWS_B64ENCODED_CREDENTIALS not defined"; exit 1)
@[ -n "$$SSH_PUBLIC_KEY" ] || (echo "SSH_PUBLIC_KEY not defined"; exit 1)
$(MAKE) e2e TEST_NAME="${TEST_NAME}" E2E_CONF_FILE="$(shell pwd)/e2e/config/aws.yaml"
$(MAKE) e2e TEST_NAME="${TEST_NAME}" E2E_INFRASTRUCTURE_PROVIDER=aws

##@ Build

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ You can verify the documentation at https://docs.k0smotron.io/ after the workflo
If you are making a new **major** or **minor** release, after publishing the release, update the E2E upgrade test to reflect the new release version:

- Add new release in `k0smotronMinorVersionsToCheckUpgrades` in [`e2e/k0smotron_upgrade_test.go`](https://github.com/k0sproject/k0smotron/blob/main/e2e/k0smotron_upgrade_test.go).
- Add the new release entry under the `k0sproject-k0smotron` provider in [`e2e/config/docker.yaml`](https://github.com/k0sproject/k0smotron/blob/main/e2e/config/docker.yaml) (including matching `control-plane-components.yaml` and `bootstrap-components.yaml` URLs).
- Add the new release entry under the `k0sproject-k0smotron` provider in [`e2e/config.yaml`](https://github.com/k0sproject/k0smotron/blob/main/e2e/config.yaml) (including matching `control-plane-components.yaml` and `bootstrap-components.yaml` URLs).
24 changes: 11 additions & 13 deletions e2e/admission_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func admissionWebhookRecreateStrategyInSingleModeSpec(t *testing.T) {
Namespace: namespace.Name,
ClusterName: clusterName,
KubernetesVersion: e2eConfig.MustGetVariable(KubernetesVersion),
ControlPlaneMachineCount: ptr.To[int64](3),
// TODO: make infra provider configurable
InfrastructureProvider: "docker",
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
ControlPlaneMachineCount: ptr.To(int64(controlPlaneMachineCount)),
WorkerMachineCount: ptr.To(int64(workerMachineCount)),
InfrastructureProvider: infrastructureProvider,
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
ClusterctlVariables: map[string]string{
"CLUSTER_NAME": clusterName,
"NAMESPACE": namespace.Name,
Expand All @@ -80,18 +80,16 @@ func admissionWebhookK0sVersionNotCompatibleSpec(t *testing.T) {
clusterName := fmt.Sprintf("%s-%s", testName, capiutil.RandomString(6))

workloadClusterTemplate := clusterctl.ConfigCluster(ctx, clusterctl.ConfigClusterInput{
ClusterctlConfigPath: clusterctlConfigPath,
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
// select cluster templates
Flavor: "webhook-k0s-not-compatible",

ClusterctlConfigPath: clusterctlConfigPath,
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
Flavor: "webhook-k0s-not-compatible",
Namespace: namespace.Name,
ClusterName: clusterName,
KubernetesVersion: e2eConfig.MustGetVariable(KubernetesVersion),
ControlPlaneMachineCount: ptr.To[int64](3),
// TODO: make infra provider configurable
InfrastructureProvider: "docker",
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
ControlPlaneMachineCount: ptr.To(int64(controlPlaneMachineCount)),
WorkerMachineCount: ptr.To(int64(workerMachineCount)),
InfrastructureProvider: infrastructureProvider,
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
ClusterctlVariables: map[string]string{
"CLUSTER_NAME": clusterName,
"NAMESPACE": namespace.Name,
Expand Down
Loading
Loading