Skip to content

Commit 638728d

Browse files
committed
Switch default capi infra provider to k0smotron in e2e
Signed-off-by: apedriza <[email protected]>
1 parent f1c73fc commit 638728d

File tree

49 files changed

+1660
-1497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1660
-1497
lines changed

.github/workflows/e2e-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
- name: Run e2e test
139139
run: |
140140
export AWS_B64ENCODED_CREDENTIALS=$(clusterawsadm bootstrap credentials encode-as-profile)
141-
make e2e TEST_NAME="${{ matrix.e2e-suite }}" E2E_CONF_FILE="$(pwd)/e2e/config/aws.yaml"
141+
make e2e-aws TEST_NAME="${{ matrix.e2e-suite }}"
142142
143143
- name: Archive artifacts
144144
if: failure()

.github/workflows/go.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -186,23 +186,6 @@ jobs:
186186
run: |
187187
make -C inttest ${{ matrix.smoke-suite }}
188188
189-
190-
capi-smokes-on-different-k0s-versions:
191-
name: CAPI Smokes Matrix
192-
needs: [build, unittest]
193-
strategy:
194-
fail-fast: false
195-
matrix:
196-
smoke-suite:
197-
- check-capi-remote-machine
198-
- check-capi-remote-machine-template
199-
k0s-version: [ "v1.28.11", "v1.29.6", "v1.30.2" ]
200-
201-
uses: ./.github/workflows/capi-smoke-tests.yml
202-
with:
203-
smoke-suite: ${{ matrix.smoke-suite }}
204-
k0s-version: ${{ matrix.k0s-version }}
205-
206189
capi-smokes:
207190
name: Cluster API smoke tests
208191
needs: [build, unittest]
@@ -223,7 +206,6 @@ jobs:
223206
- check-capi-controlplane-docker-worker
224207
- check-capi-docker-machine-change-args
225208
- check-capi-docker-machine-change-template
226-
- check-capi-remote-machine-template-update
227209
- check-capi-docker-machine-template-update
228210
- check-capi-docker-machine-template-update-recreate
229211
- check-capi-docker-machine-template-update-recreate-single
@@ -285,6 +267,6 @@ jobs:
285267
if: failure()
286268
uses: actions/[email protected]
287269
with:
288-
name: e2e-artifacts
270+
name: e2e-artifacts-${{ matrix.e2e-suite }}
289271
path: _artifacts
290272
if-no-files-found: ignore

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ __debug_bin*
4242
_artifacts
4343

4444
# E2E test templates
45-
e2e/data/infrastructure-docker/**/cluster-template*.yaml
45+
e2e/data/infrastructure-docker/**/cluster-template*.yaml
46+
e2e/data/infrastructure-k0smotron/**/cluster-template*.yaml

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
1515
CRDOC ?= $(LOCALBIN)/crdoc
1616

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

120+
## Template by infrastructure provider for e2e tests
119121
DOCKER_TEMPLATES := e2e/data/infrastructure-docker
122+
K0SMOTRON_TEMPLATES := e2e/data/infrastructure-k0smotron
120123

121124
.PHONY: generate-e2e-templates-main
122125
generate-e2e-templates-main: $(KUSTOMIZE)
@@ -127,6 +130,14 @@ generate-e2e-templates-main: $(KUSTOMIZE)
127130
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-machinedeployment --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-machinedeployment.yaml
128131
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-remote-hcp --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-remote-hcp.yaml
129132
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-ingress --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-ingress.yaml
133+
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template.yaml
134+
$(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
135+
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-webhook-k0s-not-compatible --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-webhook-k0s-not-compatible.yaml
136+
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-kcp-remediation --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-kcp-remediation.yaml
137+
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-remote-hcp --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-remote-hcp.yaml
138+
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-ingress --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-ingress.yaml
139+
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template-machinedeployment --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template-machinedeployment.yaml
140+
130141

131142

132143
e2e: generate-e2e-templates-main
@@ -135,6 +146,7 @@ e2e: generate-e2e-templates-main
135146
-artifacts-folder="$(ARTIFACTS)" \
136147
-config="$(E2E_CONF_FILE)" \
137148
-skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) \
149+
-infrastructure-provider=$(E2E_INFRASTRUCTURE_PROVIDER) \
138150
-timeout=30m
139151

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

148160
##@ Build
149161

docs/contributing/release-process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ You can verify the documentation at https://docs.k0smotron.io/ after the workflo
5757
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:
5858

5959
- Add new release in `k0smotronMinorVersionsToCheckUpgrades` in [`e2e/k0smotron_upgrade_test.go`](https://github.com/k0sproject/k0smotron/blob/main/e2e/k0smotron_upgrade_test.go).
60-
- 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).
60+
- 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).

e2e/admission_webhook_test.go

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func admissionWebhookRecreateStrategyInSingleModeSpec(t *testing.T) {
5555
Namespace: namespace.Name,
5656
ClusterName: clusterName,
5757
KubernetesVersion: e2eConfig.MustGetVariable(KubernetesVersion),
58-
ControlPlaneMachineCount: ptr.To[int64](3),
59-
// TODO: make infra provider configurable
60-
InfrastructureProvider: "docker",
61-
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
58+
ControlPlaneMachineCount: ptr.To(int64(controlPlaneMachineCount)),
59+
WorkerMachineCount: ptr.To(int64(workerMachineCount)),
60+
InfrastructureProvider: infrastructureProvider,
61+
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
6262
ClusterctlVariables: map[string]string{
6363
"CLUSTER_NAME": clusterName,
6464
"NAMESPACE": namespace.Name,
@@ -80,18 +80,16 @@ func admissionWebhookK0sVersionNotCompatibleSpec(t *testing.T) {
8080
clusterName := fmt.Sprintf("%s-%s", testName, capiutil.RandomString(6))
8181

8282
workloadClusterTemplate := clusterctl.ConfigCluster(ctx, clusterctl.ConfigClusterInput{
83-
ClusterctlConfigPath: clusterctlConfigPath,
84-
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
85-
// select cluster templates
86-
Flavor: "webhook-k0s-not-compatible",
87-
83+
ClusterctlConfigPath: clusterctlConfigPath,
84+
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
85+
Flavor: "webhook-k0s-not-compatible",
8886
Namespace: namespace.Name,
8987
ClusterName: clusterName,
9088
KubernetesVersion: e2eConfig.MustGetVariable(KubernetesVersion),
91-
ControlPlaneMachineCount: ptr.To[int64](3),
92-
// TODO: make infra provider configurable
93-
InfrastructureProvider: "docker",
94-
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
89+
ControlPlaneMachineCount: ptr.To(int64(controlPlaneMachineCount)),
90+
WorkerMachineCount: ptr.To(int64(workerMachineCount)),
91+
InfrastructureProvider: infrastructureProvider,
92+
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
9593
ClusterctlVariables: map[string]string{
9694
"CLUSTER_NAME": clusterName,
9795
"NAMESPACE": namespace.Name,

0 commit comments

Comments
 (0)