diff --git a/.github/workflows/cli-capi-k3s-matrix.yaml b/.github/workflows/cli-capi-kubeadm-matrix.yaml similarity index 84% rename from .github/workflows/cli-capi-k3s-matrix.yaml rename to .github/workflows/cli-capi-kubeadm-matrix.yaml index 10440ad..b85bc3a 100644 --- a/.github/workflows/cli-capi-k3s-matrix.yaml +++ b/.github/workflows/cli-capi-kubeadm-matrix.yaml @@ -1,5 +1,5 @@ # This workflow calls the master E2E workflow with custom variables -name: CLI-CAPI-K3s +name: CLI-CAPI-Kubeadm on: workflow_dispatch: @@ -19,9 +19,10 @@ on: qase_run_id: description: Qase run ID where the results will be reported type: string - schedule: + #schedule: # From Monday to Saturday at 3am UTC (10pm in us-central1) - - cron: '0 3 * * 1-6' + #- cron: '0 3 * * 1-6' + pull_request: jobs: cli: @@ -38,7 +39,10 @@ jobs: qase_api_token: ${{ secrets.QASE_API_TOKEN }} with: boot_type: iso - destroy_runner: ${{ github.event_name == 'schedule' && true || inputs.destroy_runner }} + bootstrap_provider: kubeadm + control_plane_provider: kubeadm + #destroy_runner: ${{ github.event_name == 'schedule' && true || inputs.destroy_runner }} + destroy_runner: false k8s_downstream_version: ${{ matrix.k8s_downstream_version }} k8s_upstream_version: ${{ matrix.k8s_upstream_version }} qase_run_id: ${{ inputs.qase_run_id }} diff --git a/.github/workflows/cli-capi-rke2-matrix.yaml b/.github/workflows/cli-capi-rke2-matrix.yaml index 1c906c8..ea96375 100644 --- a/.github/workflows/cli-capi-rke2-matrix.yaml +++ b/.github/workflows/cli-capi-rke2-matrix.yaml @@ -1,5 +1,5 @@ # This workflow calls the master E2E workflow with custom variables -name: CLI-RKE2 +name: CLI-CAPI-RKE2 on: workflow_dispatch: @@ -9,19 +9,19 @@ on: default: true type: boolean k8s_downstream_version: - description: Rancher cluster downstream version to use - default: '"v1.27.13+k3s1"' + description: Cluster downstream version to use + default: '"1.30.1"' type: string k8s_upstream_version: - description: Rancher cluster upstream version to use - default: '"v1.27.13+rke2r1"' + description: Cluster upstream version to use + default: '"v1.30.1+k3s1"' type: string qase_run_id: description: Qase run ID where the results will be reported type: string - #schedule: + schedule: # From Monday to Saturday at 3am UTC (10pm in us-central1) - #- cron: '0 3 * * 1-6' + - cron: '0 3 * * 1-6' jobs: cli: @@ -29,17 +29,20 @@ jobs: fail-fast: false max-parallel: 4 matrix: - k8s_downstream_version: ${{ fromJSON(format('[{0}]', inputs.k8s_downstream_version || '"v1.27.13+rke2r1"')) }} - k8s_upstream_version: ${{ fromJSON(format('[{0}]', inputs.k8s_upstream_version || '"v1.27.13+rke2r1"')) }} - uses: ./.github/workflows/master_e2e.yaml + k8s_downstream_version: ${{ fromJSON(format('[{0}]', inputs.k8s_downstream_version || '"1.30.1"')) }} + k8s_upstream_version: ${{ fromJSON(format('[{0}]', inputs.k8s_upstream_version || '"v1.27.13+k3s1"')) }} + uses: ./.github/workflows/master_capi_e2e.yaml secrets: credentials: ${{ secrets.GCP_CREDENTIALS }} pat_token: ${{ secrets.SELF_HOSTED_RUNNER_PAT_TOKEN }} qase_api_token: ${{ secrets.QASE_API_TOKEN }} with: + boot_type: iso + bootstrap_provider: rke2 + control_plane_provider: rke2 destroy_runner: ${{ github.event_name == 'schedule' && true || inputs.destroy_runner }} k8s_downstream_version: ${{ matrix.k8s_downstream_version }} k8s_upstream_version: ${{ matrix.k8s_upstream_version }} qase_run_id: ${{ inputs.qase_run_id }} - test_type: cli - zone: us-central1-f + test_type: capi_cli + zone: us-central1-c diff --git a/.github/workflows/master_capi_e2e.yaml b/.github/workflows/master_capi_e2e.yaml index b821d9d..03549f0 100644 --- a/.github/workflows/master_capi_e2e.yaml +++ b/.github/workflows/master_capi_e2e.yaml @@ -9,6 +9,10 @@ on: description: Choose booting type (pxe, iso, raw) default: pxe type: string + bootstrap_provider: + description: Bootstrap provider to use + default: rke2 + type: string cluster_name: description: Name of the provisioned cluster default: elemental-cluster @@ -20,6 +24,10 @@ on: cluster_number: description: Number of clusters to deploy in multi-cluster test type: string + control_plane_provider: + description: Control plane provider to use + default: rke2 + type: string destroy_runner: description: Destroy the auto-generated self-hosted runner default: true @@ -138,9 +146,11 @@ jobs: qase_api_token: ${{ secrets.qase_api_token }} with: boot_type: ${{ inputs.boot_type }} + bootstrap_provider: ${{ inputs.bootstrap_provider }} cluster_name: ${{ inputs.cluster_name }} cluster_namespace: ${{ inputs.cluster_namespace }} cluster_number: ${{ inputs.cluster_number }} + control_plane_provider: ${{ inputs.control_plane_provider }} destroy_runner: ${{ inputs.destroy_runner }} k8s_downstream_version: ${{ inputs.k8s_downstream_version }} node_number: ${{ inputs.node_number }} diff --git a/.github/workflows/sub_capi_cli.yaml b/.github/workflows/sub_capi_cli.yaml index 73fd86b..c3e4fed 100644 --- a/.github/workflows/sub_capi_cli.yaml +++ b/.github/workflows/sub_capi_cli.yaml @@ -8,12 +8,18 @@ on: boot_type: required: true type: string + bootstrap_provider: + required: true + type: string cluster_name: required: true type: string cluster_namespace: required: true type: string + control_plane_provider: + required: true + type: string destroy_runner: required: true type: boolean @@ -134,8 +140,10 @@ jobs: id: install_capi run: cd tests && make e2e-install-capi env: + BOOTSTRAP_PROVIDER: ${{ inputs.bootstrap_provider }} CLUSTER_NAME: ${{ inputs.cluster_name }} CONTROL_PLANE_ENDPOINT_HOST: "\"192.168.122.50\"" + CONTROL_PLANE_PROVIDER: ${{ inputs.control_plane_provider }} ELEMENTAL_ENABLE_DEBUG: "\"true\"" ELEMENTAL_API_ENDPOINT: "\"management-host\"" ELEMENTAL_API_ENABLE_TLS: "\"true\"" @@ -144,7 +152,16 @@ jobs: - name: Build the ISO image id: build_iso - run: cd cluster-api-provider-elemental && AGENT_CONFIG_FILE=iso/config/my-config.yaml make build-iso + run: | + cd cluster-api-provider-elemental + if ${{ contains(inputs.bootstrap_provider, 'kubeadm') }}; then + sed -i 's/tumbleweed:latest/leap:15.5/g' Dockerfile.kubeadm.os + sed -i 's/glibc-gconv-modules-extra//g' Dockerfile.kubeadm.os + sed -i 's@shim \\@shim@g' Dockerfile.kubeadm.os + AGENT_CONFIG_FILE=iso/config/my-config.yaml make build-iso-kubeadm + else + AGENT_CONFIG_FILE=iso/config/my-config.yaml make build-iso + fi - name: Extract iPXE artifacts from ISO id: extract_ipxe_artifacts diff --git a/.github/workflows/sub_test_choice.yaml b/.github/workflows/sub_test_choice.yaml index c435a7c..05d55b4 100644 --- a/.github/workflows/sub_test_choice.yaml +++ b/.github/workflows/sub_test_choice.yaml @@ -8,6 +8,9 @@ on: boot_type: required: true type: string + bootstrap_provider: + required: true + type: string cluster_name: required: true type: string @@ -17,6 +20,9 @@ on: cluster_namespace: required: true type: string + control_plane_provider: + required: true + type: string destroy_runner: required: true type: boolean @@ -71,8 +77,10 @@ jobs: qase_api_token: ${{ secrets.qase_api_token }} with: boot_type: ${{ inputs.boot_type }} + bootstrap_provider: ${{ inputs.bootstrap_provider }} cluster_name: ${{ inputs.cluster_name }} cluster_namespace: ${{ inputs.cluster_namespace }} + control_plane_provider: ${{ inputs.control_plane_provider }} destroy_runner: ${{ inputs.destroy_runner }} k8s_downstream_version: ${{ inputs.k8s_downstream_version }} node_number: ${{ inputs.node_number }} diff --git a/README.md b/README.md index fcd1020..1a81460 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,4 @@ e2e test for the CAPI Elemental provider ## Daily CI -[![CLI-CAPI-K3s](https://github.com/rancher-sandbox/elemental-e2e/actions/workflows/cli-capi-k3s-matrix.yaml/badge.svg?branch=main)](https://github.com/rancher-sandbox/elemental-e2e/actions/workflows/cli-capi-k3s-matrix.yaml) +[![CLI-CAPI-RKE2](https://github.com/rancher-sandbox/elemental-e2e/actions/workflows/cli-capi-rke2-matrix.yaml/badge.svg?branch=main)](https://github.com/rancher-sandbox/elemental-e2e/actions/workflows/cli-capi-rke2-matrix.yaml) diff --git a/tests/e2e/bootstrap_capi_test.go b/tests/e2e/bootstrap_capi_test.go index be1c143..31b38cd 100644 --- a/tests/e2e/bootstrap_capi_test.go +++ b/tests/e2e/bootstrap_capi_test.go @@ -10,6 +10,7 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + */ package e2e_test diff --git a/tests/e2e/install_capi_test.go b/tests/e2e/install_capi_test.go index ad4c72a..03bebd8 100644 --- a/tests/e2e/install_capi_test.go +++ b/tests/e2e/install_capi_test.go @@ -87,8 +87,8 @@ var _ = Describe("E2E - Install CAPI", Label("install-capi"), func() { out, err := exec.Command("/usr/local/bin/clusterctl", "--v", "4", "init", - "--bootstrap", "rke2", - "--control-plane", "rke2", + "--bootstrap", bootstrapProvider, + "--control-plane", controlPlaneProvider, "--infrastructure", "elemental:v0.0.0").CombinedOutput() // Show command output, easier to debug GinkgoWriter.Printf("%s\n", string(out)) @@ -123,7 +123,7 @@ var _ = Describe("E2E - Install CAPI", Label("install-capi"), func() { "--control-plane-machine-count=1", "--worker-machine-count=2", "--infrastructure", "elemental:v0.0.0", - "--flavor", "rke2", + "--flavor", bootstrapProvider, "--target-namespace", clusterNS, clusterName, "--kubernetes-version="+k8sDownstreamVersion, diff --git a/tests/e2e/suite_test.go b/tests/e2e/suite_test.go index 83ae219..b716dc3 100644 --- a/tests/e2e/suite_test.go +++ b/tests/e2e/suite_test.go @@ -46,10 +46,12 @@ const ( ) var ( + bootstrapProvider string clusterName string clusterNS string clusterType string clusterYaml string + controlPlaneProvider string elementalAPIEndpoint string elementalSupport string emulateTPM bool @@ -323,9 +325,11 @@ type YamlPattern struct { var _ = BeforeSuite(func() { bootTypeString := os.Getenv("BOOT_TYPE") + bootstrapProvider = os.Getenv("BOOTSTRAP_PROVIDER") clusterName = os.Getenv("CLUSTER_NAME") clusterNS = os.Getenv("CLUSTER_NS") clusterType = os.Getenv("CLUSTER_TYPE") + controlPlaneProvider = os.Getenv("CONTROLPLANE_PROVIDER") elementalAPIEndpoint = os.Getenv("ELEMENTAL_API_ENDPOINT") elementalSupport = os.Getenv("ELEMENTAL_SUPPORT") eTPM := os.Getenv("EMULATE_TPM")