Skip to content

Commit 006ef5b

Browse files
gpeimehabhalodiya
authored andcommitted
Wait for worker MCP to be updated before running RHEL worker upgrade (openshift#65478)
* Wait for worker MCP to be updated before running RHEL worker upgrade * remove useless lines
1 parent 9e8c18a commit 006ef5b

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

ci-operator/step-registry/cucushift/chainupgrade/toimage/cucushift-chainupgrade-toimage-commands.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,30 @@ EOF
310310
ansible-playbook -i "${SHARED_DIR}/ansible-hosts" /tmp/repo.yaml -vvv
311311
}
312312

313+
function rhel_pre_unpause(){
314+
echo "Running the workaround step before unpausing worker mcp"
315+
local testcase="rhel"
316+
cat > /tmp/rhel_pre_unpause.yaml <<-'EOF'
317+
---
318+
- name: RHEL pre-unpause playbook
319+
hosts: workers
320+
any_errors_fatal: true
321+
gather_facts: false
322+
vars:
323+
required_packages:
324+
- ose-azure-acr-image-credential-provider
325+
- ose-gcp-gcr-image-credential-provider
326+
tasks:
327+
- name: Install required package on the node
328+
dnf:
329+
name: "{{ required_packages }}"
330+
state: latest
331+
disable_gpg_check: true
332+
EOF
333+
ansible-inventory -i "${SHARED_DIR}/ansible-hosts" --list --yaml
334+
ansible-playbook -i "${SHARED_DIR}/ansible-hosts" /tmp/rhel_pre_unpause.yaml -vvv
335+
}
336+
313337
# Do sdn migration to ovn since sdn is not supported from 4.17 version
314338
function sdn2ovn(){
315339
oc patch network.operator.openshift.io cluster --type='merge' -p='{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"ipv4":{"internalJoinSubnet": "100.65.0.0/16"}}}}}'
@@ -1154,6 +1178,12 @@ for target in "${TARGET_RELEASES[@]}"; do
11541178
run_command "oc get node -owide"
11551179
if [[ $(oc get machineconfigpools worker -ojson | jq -r '.spec.paused') == "true" ]]; then
11561180
echo "worker mcp are paused, it sounds eus upgrade, skip rhel worker upgrade here, should upgrade them after worker mcp unpaused"
1181+
#Temporary workaround for 4.14 to 4.16 cpou test with RHEL workers, would be removed until https://github.com/openshift/openshift-ansible/pull/12531 merged
1182+
if [[ "${SOURCE_MINOR_VERSION}" == "14" ]]; then
1183+
echo "Running workaround for https://issues.redhat.com/browse/OCPBUGS-32057 in 4.14 to 4.16 cpou test"
1184+
rhel_repo
1185+
rhel_pre_unpause
1186+
fi
11571187
else
11581188
rhel_repo
11591189
rhel_upgrade

ci-operator/step-registry/cucushift/upgrade/cpou/unpause-worker-mcp/cucushift-upgrade-cpou-unpause-worker-mcp-commands.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ for mcp in "${normal_mcp_arr[@]}"
9090
do
9191
check_mcp ${mcp} "True"
9292
done
93-
current_minor_ver="$(oc get clusterversion --no-headers | awk '{print $2}' | cut -f2 -d.)"
94-
echo -e "current minor version: ${current_minor_ver} \n"
9593

9694
IFS=" " read -r -a arr <<<"$PAUSED_MCP_NAME"
9795
for mcp in "${arr[@]}";
@@ -100,11 +98,5 @@ do
10098
printf "\n"
10199
unpause ${mcp}
102100
printf "\n"
103-
if [[ "${current_minor_ver}" -lt "19" ]] && [[ $(oc get nodes -l node.openshift.io/os_id=rhel) != "" ]]; then
104-
echo "Found rhel worker, this step is supposed to be used in eus upgrade, skipping mcp checking here, need to check it after rhel worker upgraded..."
105-
run_command "oc get machineconfigpools"
106-
run_command "oc get node -owide"
107-
else
108-
check_mcp ${mcp} "True"
109-
fi
110-
done
101+
check_mcp ${mcp} "True"
102+
done

0 commit comments

Comments
 (0)