Description of problem: Meet 2 issues when running wsu against OCP 4.5.0-0.nightly-2020-05-27-220943 1, When kubernetes version is not in the form of 'v1.17.2', run wsu failed in TASK [Get kube node binary SHA], grep command return blank. # curl -s https://github.com/kubernetes/kubernetes/blob/release-1.18/CHANGELOG/CHANGELOG-1.18.md | grep -A 1 "v1.18.3+144c666" # 2, TASK [Get kube node binary SHA] fail due to kubernetes CHANGELOG-1.18.md format change, see compare result of v1.18.3 vs v1.18.2 # curl -s "https://github.com/kubernetes/kubernetes/blob/release-1.18/CHANGELOG/CHANGELOG-1.18.md" | grep -A 1 "v1.18.3" | grep -A 1 node-windows | tail -n 1 <td>f83802db06a86edd9ade8e737ed0e8a11ebeeaa69e102f9550b90f0d8a724e7864f6531f7f500ff70d4202168a774c5b328fea1ec0a95b9e275a0233a852f04f</td> # curl -s "https://github.com/kubernetes/kubernetes/blob/release-1.18/CHANGELOG/CHANGELOG-1.18.md" | grep -A 1 "v1.18.2" | grep -A 1 node-windows | tail -n 1 <td><code>f121f7893c102ecd491189077ccbddd7aa0625cf2bfe855a7be00cfe615e6d397928cb5448092993626f33b216e89ac11bd0c09255847e1b6ba9a54a933eee53</code></td> Version-Release number of selected component (if applicable): # oc version Client Version: 4.4.0-rc.3 Server Version: 4.5.0-0.nightly-2020-05-27-220943 Kubernetes Version: v1.18.3+144c666 windows-machine-config-bootstrapper git commit: d236306822e0526932ac6a4850fb8d537908307c How reproducible: Special build Steps to Reproduce: 1. Install cluster with OVNKubernetes 2. Launch Windows instance with win 3. Run wsu ansible failed # ansible-playbook -i hosts ~/go/src/windows-machine-config-bootstrapper/tools/ansible/tasks/wsu/main.yaml -v Using /etc/ansible/ansible.cfg as config file PLAY [localhost] ************************************************************************************************************************************************************************************************** TASK [Gathering Facts] ******************************************************************************************************************************************************************************************** ok: [localhost] TASK [Check if cluster is using ovn-kubernetes] ******************************************************************************************************************************************************************* changed: [localhost] => {"changed": true, "cmd": "oc get network cluster -o jsonpath='{.spec.networkType}'", "delta": "0:00:00.196440", "end": "2020-05-28 08:41:54.716465", "failed_when_result": false, "rc": 0, "start": "2020-05-28 08:41:54.520025", "stderr": "", "stderr_lines": [], "stdout": "OVNKubernetes", "stdout_lines": ["OVNKubernetes"]} TASK [Check hybrid overlay is enabled] **************************************************************************************************************************************************************************** changed: [localhost] => {"changed": true, "cmd": "oc get network.operator cluster -o jsonpath='{.spec.defaultNetwork.ovnKubernetesConfig.hybridOverlayConfig.hybridClusterNetwork}'", "delta": "0:00:00.181975", "end": "2020-05-28 08:41:55.107745", "rc": 0, "start": "2020-05-28 08:41:54.925770", "stderr": "", "stderr_lines": [], "stdout": "[map[cidr:10.132.0.0/14 hostPrefix:23]]", "stdout_lines": ["[map[cidr:10.132.0.0/14 hostPrefix:23]]"]} TASK [Fail if hybrid overlay is not enabled] ********************************************************************************************************************************************************************** skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [Get kubernetes version] ************************************************************************************************************************************************************************************* changed: [localhost] => {"changed": true, "cmd": "oc version -o json | jq -r '.serverVersion.gitVersion'", "delta": "0:00:00.233268", "end": "2020-05-28 08:41:55.573587", "failed_when_result": false, "rc": 0, "start": "2020-05-28 08:41:55.340319", "stderr": "", "stderr_lines": [], "stdout": "v1.18.3+144c666", "stdout_lines": ["v1.18.3+144c666"]} TASK [Get kubernetes version without patch version] *************************************************************************************************************************************************************** changed: [localhost] => {"changed": true, "cmd": "version=v1.18.3+144c666 ; baseVersion=${version%-*} ; echo ${baseVersion%.*} | tr -d v", "delta": "0:00:00.005426", "end": "2020-05-28 08:41:55.818831", "failed_when_result": false, "rc": 0, "start": "2020-05-28 08:41:55.813405", "stderr": "", "stderr_lines": [], "stdout": "1.18", "stdout_lines": ["1.18"]} TASK [Get kubernetes changelog url] ******************************************************************************************************************************************************************************* changed: [localhost] => {"changed": true, "cmd": "echo \"https://github.com/kubernetes/kubernetes/blob/release-\"\\\n\"1.18/CHANGELOG/CHANGELOG-\"\\\n\"1.18.md\"\n", "delta": "0:00:00.004227", "end": "2020-05-28 08:41:56.040860", "rc": 0, "start": "2020-05-28 08:41:56.036633", "stderr": "", "stderr_lines": [], "stdout": "https://github.com/kubernetes/kubernetes/blob/release-1.18/CHANGELOG/CHANGELOG-1.18.md", "stdout_lines": ["https://github.com/kubernetes/kubernetes/blob/release-1.18/CHANGELOG/CHANGELOG-1.18.md"]} TASK [Get kube node binary SHA] *********************************************************************************************************************************************************************************** [WARNING]: Consider using the get_url or uri module rather than running 'curl'. If you need to use command because get_url or uri is insufficient you can add 'warn: false' to this command task or set 'command_warnings=False' in ansible.cfg to get rid of this message. fatal: [localhost]: FAILED! => {"changed": true, "cmd": "curl -s \"https://github.com/kubernetes/kubernetes/blob/release-1.18/CHANGELOG/CHANGELOG-1.18.md\" | grep -A 1 \"v1.18.3+144c666\" | grep -A 1 node-windows | tail -n 1 | sed -e 's/.*<code>\\(.*\\)<\\/code>.*/\\1/'\n", "delta": "0:00:00.753549", "end": "2020-05-28 08:41:57.012955", "failed_when_result": true, "rc": 0, "start": "2020-05-28 08:41:56.259406", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []} PLAY RECAP ******************************************************************************************************************************************************************************************************** localhost : ok=6 changed=5 unreachable=0 failed=1 skipped=1 rescued=0 ignored=0 Actual results: Run wsu failed Expected results: Run wsu succeed Additional info: For workaround, apply following changes to main.yaml, run wsu succeed with this OCP build. # git diff diff --git a/tools/ansible/tasks/wsu/main.yaml b/tools/ansible/tasks/wsu/main.yaml index eee1ad5..8355d3d 100644 --- a/tools/ansible/tasks/wsu/main.yaml +++ b/tools/ansible/tasks/wsu/main.yaml @@ -22,7 +22,7 @@ # Expected value of kubernetes_version in the form of 'v1.17.2' - name: Get kubernetes version - shell: "oc version -o json | jq -r '.serverVersion.gitVersion'" + shell: "oc version -o json | jq -r '.serverVersion.gitVersion' | cut -d '+' -f1" register: kubernetes_version failed_when: kubernetes_version.stdout == "" @@ -46,7 +46,7 @@ shell: | curl -s "{{ changelog.stdout }}" | \ grep -A 1 "{{ kubernetes_version.stdout }}" | \ - grep -A 1 node-windows | tail -n 1 | sed -e 's/.*<code>\(.*\)<\/code>.*/\1/' + grep -A 1 node-windows | tail -n 1 | sed -e 's/.*<td>\(.*\)<\/td>.*/\1/' register: kube_node_sha failed_when: kube_node_sha.stdout == ""
This bug has been verified and passed on OCP 4.5.0-0.nightly-2020-05-27-164802, thanks. Steps to Reproduce: 1. Install cluster with OVNKubernetes 2. Launch Windows instance with win 3. Run wsu ansible succeed # ansible-playbook -i hosts ~/go/src/windows-machine-config-bootstrapper/tools/ansible/tasks/wsu/main.yaml -v ... PLAY RECAP ****************************** 18.191.152.171 : ok=34 changed=26 unreachable=0 failed=0 skipped=4 rescued=0 ignored=1 localhost : ok=27 changed=24 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0
@gaoshang, we received a report (https://github.com/openshift/windows-machine-config-bootstrapper/issues/209) that this issue is showing up on 4.4.7. Please confirm and let us know if we need to reopen the bug.
(In reply to Aravindh Puthiyaparambil from comment #4) > @gaoshang, we received a report > (https://github.com/openshift/windows-machine-config-bootstrapper/issues/ > 209) that this issue is showing up on 4.4.7. Please confirm and let us know > if we need to reopen the bug. Run WSU succeed here with OCP 4.4.7, please check attachment for ansible run log, thanks. Version: windows-machine-config-bootstrapper git commit 6d84703de8459a24e4333aca05f89853ead72f87 # oc version Client Version: 4.4.0-rc.3 Server Version: 4.4.7 Kubernetes Version: v1.17.1+f5fb168 # oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.4.7 True False 52m Cluster version is 4.4.7
Created attachment 1696247 [details] Run WSU against OCP 4.4.7
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2409