Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
juadk committed Jan 19, 2024
1 parent 690d506 commit 926661c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 23 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/master-airgap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ on:
test_description:
description: Short description of the test
type: string
test_type:
description: Type of test to run (cli or ui)
default: airgap
type: string
upstream_cluster_version:
description: Cluster upstream version where to install Rancher (K3s or RKE2)
default: v1.26.8
Expand Down Expand Up @@ -144,6 +148,7 @@ jobs:
QASE_RUN_ID: ${{ inputs.qase_run_id }}
# For Rancher Manager
RANCHER_VERSION: ${{ inputs.rancher_version }}
TEST_TYPE: ${{ inputs.test_type }}
TIMEOUT_SCALE: 3
steps:
- name: Checkout
Expand All @@ -153,11 +158,9 @@ jobs:
with:
go-version-file: tests/go.mod
- name: Prepare the archive file to send to air-gapped nodes
run: |
cd tests && make e2e-prepare-archive
run: cd tests && make e2e-prepare-archive
- name: Deploy airgap infrastructure
run: |
cd tests && make e2e-airgap-rancher
run: cd tests && make e2e-airgap-rancher
- name: Configure Rancher & Libvirt
run: cd tests && make e2e-configure-rancher
- name: Extract component versions/informations
Expand Down Expand Up @@ -193,18 +196,14 @@ jobs:
EMULATE_TPM: true
OS_TO_TEST: ${{ inputs.os_to_test }}
POOL: master
run: |
export ISO_BOOT=true
cd tests && make e2e-iso-image
run: cd tests && ISO_BOOT=true make e2e-iso-image
- name: Bootstrap node 1, 2 and 3 in pool "master" (use Emulated TPM if possible)
env:
EMULATE_TPM: true
POOL: master
VM_START: 1
VM_END: 3
run: |
export ISO_BOOT=true
cd tests && VM_INDEX=${VM_START} VM_NUMBERS=${VM_END} make e2e-bootstrap-node
run: cd tests && VM_INDEX=${VM_START} VM_NUMBERS=${VM_END} ISO_BOOT=true make e2e-bootstrap-node
- name: Add summary
if: ${{ always() }}
run: |
Expand Down
39 changes: 39 additions & 0 deletions tests/assets/cluster-airgap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
kind: Cluster
apiVersion: provisioning.cattle.io/v1
metadata:
name: %CLUSTER_NAME%
# namespace: fleet-default
spec:
rkeConfig:
etcd:
disableSnapshots: true
machineGlobalConfig:
cni: canal
disable:
- rke2-metrics-server
- metrics-server
etcd-expose-metrics: false
profile: null
machinePools:
- controlPlaneRole: true
etcdRole: true
machineConfigRef:
apiVersion: elemental.cattle.io/v1beta1
kind: MachineInventorySelectorTemplate
name: selector-%CLUSTER_NAME%
name: pool-%CLUSTER_NAME%
quantity: 3
unhealthyNodeTimeout: 0s
workerRole: true
machineSelectorConfig:
- config:
protect-kernel-defaults: false
registries:
configs:
rancher-manager.test:5000:
insecureSkipVerify: true
mirrors:
rancher-manager.test:5000:
endpoint:
- http://rancher-manager.test:5000
kubernetesVersion: %K8S_VERSION%
9 changes: 1 addition & 8 deletions tests/assets/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,5 @@ spec:
machineSelectorConfig:
- config:
protect-kernel-defaults: false
registries:
configs:
rancher-manager.test:5000:
insecureSkipVerify: true
mirrors:
rancher-manager.test:5000:
endpoint:
- http://rancher-manager.test:5000
registries: {}
kubernetesVersion: %K8S_VERSION%
5 changes: 5 additions & 0 deletions tests/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@ var _ = BeforeSuite(func() {
selectorYaml = "../assets/selector.yaml"
}

// Enable airgap support if needed
if testType == "airgap" {
clusterYaml = "../assets/cluster-airgap.yaml"
}

// Start HTTP server
tools.HTTPShare("../..", ":8000")
})
7 changes: 2 additions & 5 deletions tests/scripts/build-airgap
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ cd /opt/rancher/helm/

# Add repos
helm repo add jetstack https://charts.jetstack.io > /dev/null 2>&1
#helm repo add rancher-latest https://releases.rancher.com/server-charts/latest > /dev/null 2>&1
helm repo add rancher-$RANCHER_CHANNEL https://releases.rancher.com/server-charts/$RANCHER_CHANNEL > /dev/null 2>&1
helm repo update > /dev/null 2>&1

# Get charts
helm pull jetstack/cert-manager --version $CERT_MANAGER_VERSION > /dev/null 2>&1
#helm pull rancher-latest/rancher --version v$RANCHER_MANAGER_VERSION > /dev/null 2>&1
if [ "$RANCHER_CHANNEL" == "latest" ]; then
if [[ "$RANCHER_CHANNEL" == "latest" ]]; then
helm pull rancher-$RANCHER_CHANNEL/rancher --devel > /dev/null 2>&1
else
helm pull rancher-$RANCHER_CHANNEL/rancher > /dev/null 2>&1
Expand All @@ -57,13 +55,11 @@ wget https://raw.githubusercontent.com/fgiudici/elemental-operator/airgap-allow-
chmod +x elemental-airgap.sh
./elemental-airgap.sh -r localhost:5000 -sa dev


# Get Images - Rancher/Elemental
cd /opt/rancher/images/

# Rancher image list
curl -#L https://github.com/rancher/rancher/releases/download/v${RANCHER_MANAGER_VERSION%.*}/rancher-images.txt -o rancher/orig_rancher-images.txt
#curl -#L https://github.com/rancher/rancher/releases/download/v2.7.9/rancher-images.txt -o rancher/orig_rancher-images.txt

# Shorten rancher list with a sort
# Fix library tags
Expand Down Expand Up @@ -96,6 +92,7 @@ helm template --kube-version=1.22 /opt/rancher/helm/cert-manager-$CERT_MANAGER_V
# Elemental image list
helm template --kube-version=1.22 /opt/rancher/helm/elemental-operator-chart-*.tgz | awk '$1 ~ /image:/ {print $2}' | sed s/\"//g > elemental/elemental-images.txt
helm template --kube-version=1.22 /opt/rancher/helm/elemental-operator-chart-*.tgz|grep 'seedimage-builder' | awk '{print $2}' >> elemental/elemental-images.txt

# Temporary thing to get latest version of elemental-teal-iso (very ugly...)
grep 'registry.opensuse.*sle-micro-iso' /opt/rancher/helm/elemental-images.txt >> elemental/elemental-images.txt

Expand Down

0 comments on commit 926661c

Please sign in to comment.