From e1ef4d749dc7001d8bcca13a0aecdce816547903 Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Fri, 23 Aug 2024 15:20:34 -0700 Subject: [PATCH] Skip kube-vip-prepare for 1.31+ k8s since CAPI won't depend on super-admin.conf Signed-off-by: Lubron Zhan --- internal/kubevip/kube-vip-prepare.sh | 4 ++-- templates/cluster-template-ignition.yaml | 6 +++--- templates/cluster-template-node-ipam.yaml | 6 +++--- templates/cluster-template-supervisor.yaml | 6 +++--- templates/cluster-template.yaml | 6 +++--- templates/clusterclass-template-supervisor.yaml | 6 +++--- templates/clusterclass-template.yaml | 6 +++--- .../v1.10/clusterclass/clusterclass-quick-start.yaml | 5 +++-- .../v1.11/clusterclass/clusterclass-quick-start.yaml | 6 +++--- .../v1.9/clusterclass/clusterclass-quick-start.yaml | 6 +++--- .../clusterclass/clusterclass-quick-start-supervisor.yaml | 6 +++--- .../clusterclass/clusterclass-quick-start-supervisor.yaml | 6 +++--- .../clusterclass/clusterclass-quick-start-supervisor.yaml | 6 +++--- 13 files changed, 38 insertions(+), 37 deletions(-) diff --git a/internal/kubevip/kube-vip-prepare.sh b/internal/kubevip/kube-vip-prepare.sh index ec03fc9853..84e7300355 100644 --- a/internal/kubevip/kube-vip-prepare.sh +++ b/internal/kubevip/kube-vip-prepare.sh @@ -19,9 +19,9 @@ set -e # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 -# Nothing to do for kubernetes < v1.29 +# Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" -if [[ "$KUBEADM_MINOR" -lt "29" ]]; then +if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi diff --git a/templates/cluster-template-ignition.yaml b/templates/cluster-template-ignition.yaml index 033ef4d6be..b4875917a2 100644 --- a/templates/cluster-template-ignition.yaml +++ b/templates/cluster-template-ignition.yaml @@ -175,9 +175,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -1582,4 +1582,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' \ No newline at end of file + namespace: '${NAMESPACE}' diff --git a/templates/cluster-template-node-ipam.yaml b/templates/cluster-template-node-ipam.yaml index 8ed65b06a5..9e2899d875 100644 --- a/templates/cluster-template-node-ipam.yaml +++ b/templates/cluster-template-node-ipam.yaml @@ -212,9 +212,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -1497,4 +1497,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' \ No newline at end of file + namespace: '${NAMESPACE}' diff --git a/templates/cluster-template-supervisor.yaml b/templates/cluster-template-supervisor.yaml index a51d2b0b76..cc1e8aa851 100644 --- a/templates/cluster-template-supervisor.yaml +++ b/templates/cluster-template-supervisor.yaml @@ -169,9 +169,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -1447,4 +1447,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' \ No newline at end of file + namespace: '${NAMESPACE}' diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index 205fd40824..4dd1af9394 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -202,9 +202,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -1487,4 +1487,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' \ No newline at end of file + namespace: '${NAMESPACE}' diff --git a/templates/clusterclass-template-supervisor.yaml b/templates/clusterclass-template-supervisor.yaml index 10561ef024..9df16b41f5 100644 --- a/templates/clusterclass-template-supervisor.yaml +++ b/templates/clusterclass-template-supervisor.yaml @@ -150,9 +150,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/templates/clusterclass-template.yaml b/templates/clusterclass-template.yaml index dad9f0c707..dad47207ae 100644 --- a/templates/clusterclass-template.yaml +++ b/templates/clusterclass-template.yaml @@ -164,9 +164,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -379,4 +379,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass/clusterclass-quick-start.yaml index 1451376109..e725fce2a7 100644 --- a/test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass/clusterclass-quick-start.yaml @@ -165,9 +165,10 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. + KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi diff --git a/test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass/clusterclass-quick-start.yaml index dad9f0c707..dad47207ae 100644 --- a/test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass/clusterclass-quick-start.yaml @@ -164,9 +164,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -379,4 +379,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass/clusterclass-quick-start.yaml index 125c7ed255..6368fc5043 100644 --- a/test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass/clusterclass-quick-start.yaml @@ -165,10 +165,10 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then - return + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then + exit 0 fi IS_KUBEADM_INIT="false" diff --git a/test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass/clusterclass-quick-start-supervisor.yaml b/test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass/clusterclass-quick-start-supervisor.yaml index 10561ef024..9df16b41f5 100644 --- a/test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass/clusterclass-quick-start-supervisor.yaml +++ b/test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass/clusterclass-quick-start-supervisor.yaml @@ -150,9 +150,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass/clusterclass-quick-start-supervisor.yaml b/test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass/clusterclass-quick-start-supervisor.yaml index 10561ef024..9df16b41f5 100644 --- a/test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass/clusterclass-quick-start-supervisor.yaml +++ b/test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass/clusterclass-quick-start-supervisor.yaml @@ -150,9 +150,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass/clusterclass-quick-start-supervisor.yaml b/test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass/clusterclass-quick-start-supervisor.yaml index f58e3d6dea..8b2c4a5b11 100644 --- a/test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass/clusterclass-quick-start-supervisor.yaml +++ b/test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass/clusterclass-quick-start-supervisor.yaml @@ -150,9 +150,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done