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

ci: add rke2 as upstream cluster in CLI tests #844

Merged
merged 1 commit into from
May 25, 2023
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/cli-rke2-obs_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ jobs:
k8s_version_to_provision: v1.25.7+rke2r1
operator_version: oci://registry.opensuse.org/isv/rancher/elemental/dev/charts/rancher/elemental-operator-chart
rancher_version: ${{ inputs.rancher_version }}
upstream_cluster_version: v1.25.7+rke2r1
1 change: 1 addition & 0 deletions .github/workflows/cli-rke2-obs_stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ jobs:
k8s_version_to_provision: v1.25.7+rke2r1
operator_version: oci://registry.opensuse.org/isv/rancher/elemental/stable/charts/rancher/elemental-operator-chart
rancher_version: ${{ inputs.rancher_version }}
upstream_cluster_version: v1.25.7+rke2r1
1 change: 1 addition & 0 deletions .github/workflows/cli-rke2-obs_staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ jobs:
k8s_version_to_provision: v1.25.7+rke2r1
operator_version: oci://registry.opensuse.org/isv/rancher/elemental/staging/charts/rancher/elemental-operator-chart
rancher_version: ${{ inputs.rancher_version }}
upstream_cluster_version: v1.25.7+rke2r1
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ jobs:
upgrade_channel_list: registry.opensuse.org/isv/rancher/elemental/dev/teal53/15.4/rancher/elemental-teal-dev-channel/5.3:latest
upgrade_image: registry.opensuse.org/isv/rancher/elemental/dev/teal53/15.4/rancher/elemental-teal/5.3:latest
upgrade_os_channel: dev
upstream_cluster_version: v1.25.7+rke2r1
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ jobs:
upgrade_channel_list: registry.opensuse.org/isv/rancher/elemental/dev/teal53/15.4/rancher/elemental-teal-dev-channel/5.3:latest
upgrade_image: registry.opensuse.org/isv/rancher/elemental/dev/teal53/15.4/rancher/elemental-teal/5.3:latest
upgrade_os_channel: dev
upstream_cluster_version: v1.25.7+rke2r1
1 change: 1 addition & 0 deletions .github/workflows/cli-rke2-os-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ jobs:
upgrade_channel_list: registry.opensuse.org/isv/rancher/elemental/dev/teal53/15.4/rancher/elemental-teal-dev-channel/5.3:latest
upgrade_image: registry.opensuse.org/isv/rancher/elemental/${{ inputs.upgrade_os_channel }}/teal53/15.4/rancher/elemental-teal/5.3:latest
upgrade_os_channel: ${{ inputs.upgrade_os_channel }}
upstream_cluster_version: v1.25.7+rke2r1
1 change: 1 addition & 0 deletions .github/workflows/cli-rke2-rancher_latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ jobs:
cluster_name: cluster-rke2
k8s_version_to_provision: v1.25.7+rke2r1
rancher_version: latest/devel
upstream_cluster_version: v1.25.7+rke2r1
1 change: 1 addition & 0 deletions .github/workflows/cli-rke2-rancher_stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
k8s_version_to_provision: v1.25.7+rke2r1
start_condition: ${{ github.event.workflow_run.conclusion }}
workflow_download: ${{ github.event.workflow_run.workflow_id }}
upstream_cluster_version: v1.25.7+rke2r1
11 changes: 8 additions & 3 deletions .github/workflows/master-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,19 @@ jobs:
- name: Configure Rancher & Libvirt
if: inputs.test_type == 'cli'
run: cd tests && make e2e-configure-rancher
- name: Bootstrap node 1, 2 and 3 (with iPXE) in pool "master" (use Emulated TPM if possible)
- name: Bootstrap node 1, 2 and 3 in pool "master" (use Emulated TPM if possible)
if: inputs.test_type == 'cli'
env:
EMULATE_TPM: true
POOL: master
VM_START: 1
VM_END: 3
run: |
# Only use ISO boot if the upstream cluster is RKE2
# due to issue with pxe, dhcp traffic
if ${{ contains(inputs.upstream_cluster_version, 'rke') }}; then
export ISO_BOOT=true
fi
OPERATOR_VERSION=$(echo ${{ steps.component.outputs.operator_version }} \
| awk -F ':' '{print substr($2,0,3)}')
# If elemental-operator is a v1.0.x we should disable EMULATE_TPM
Expand Down Expand Up @@ -461,7 +466,7 @@ jobs:
VM_INDEX: 2
VM_NUMBERS: 3
run: cd tests && make e2e-upgrade-node
- name: Bootstrap additional nodes (with ISO) in pool "worker" (total of ${{ inputs.node_number }})
- name: Bootstrap additional nodes in pool "worker" (total of ${{ inputs.node_number }})
if: inputs.test_type == 'cli' && inputs.node_number > 3
env:
ISO_BOOT: true
Expand All @@ -482,7 +487,7 @@ jobs:
if: inputs.test_type == 'cli'
run: sudo virsh list
- name: Test Backup/Restore Elemental resources with Rancher Manager
if: inputs.test_type == 'cli'
if: inputs.test_type == 'cli' && contains(inputs.upstream_cluster_version, 'k3s')
env:
BACKUP_RESTORE_VERSION: ${{ inputs.backup_restore_version }}
run: cd tests && make e2e-backup-restore
Expand Down
21 changes: 14 additions & 7 deletions tests/e2e/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ var _ = Describe("E2E - Bootstrapping node", Label("bootstrap"), func() {
}

if isoBoot == "true" {
By("Adding registration file to ISO", func() {
// Check if generated ISO is already here
isIso, _ := exec.Command("bash", "-c", "ls ../../elemental-*.iso").Output()
// Check if generated ISO is already here
isIso, _ := exec.Command("bash", "-c", "ls ../../elemental-*.iso").Output()

// No need to recreate the ISO twice
if len(isIso) == 0 {
// No need to recreate the ISO twice
if len(isIso) == 0 {
By("Adding registration file to ISO", func() {
out, err := exec.Command(
"bash", "-c",
"../../.github/elemental-iso-add-registration "+installConfigYaml+" ../../build/elemental-*.iso",
Expand All @@ -140,8 +140,8 @@ var _ = Describe("E2E - Bootstrapping node", Label("bootstrap"), func() {
// Move generated ISO to the destination directory
err = exec.Command("bash", "-c", "mv -f elemental-*.iso ../..").Run()
Expect(err).To(Not(HaveOccurred()))
}
})
})
}
}

// Loop on node provisionning
Expand Down Expand Up @@ -435,5 +435,12 @@ var _ = Describe("E2E - Bootstrapping node", Label("bootstrap"), func() {
By("Checking cluster state after reboot", func() {
CheckClusterState(clusterNS, clusterName)
})

if isoBoot == "true" {
By("Removing the ISO", func() {
err := exec.Command("bash", "-c", "rm -f ../../*.iso").Run()
Expect(err).To(Not(HaveOccurred()))
})
}
})
})