Bug 1316761

Summary: It should compare curr_version with g_new_version in pre.yml
Product: OpenShift Container Platform Reporter: Anping Li <anli>
Component: Cluster Version OperatorAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED ERRATA QA Contact: Anping Li <anli>
Severity: medium Docs Contact:
Priority: low    
Version: 3.2.0CC: aos-bugs, bleanhar, jokerman, mmccomas, tdawson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-ansible-3.0.57-1.git.0.c633ce7.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 16:32:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anping Li 2016-03-11 02:47:47 UTC
Description of problem:
If we specify the openshift_image_tag in inventory file.
When checking upgrade packages, it should verify the g_new_version > curr_version in pre.yml. If we use registy.access.redhat.com, I guess the avail_version is always larger than curr_version. 

Version-Release number of selected component (if applicable):
atomic-openshift-utils-3.0.55

How reproducible:
always

Steps to Reproduce:
1.In a confused registry server, the openshift3/ose:latest is v3.1.0.4,current version is v3.1.1.6, If we specify openshift_image_tag=v3.2.0.1 in inventory file. 
2. run upgrade playbook
3.

Actual results:
changed: [minimaster.example.com] => {"changed": true, "rc": 0, "stderr": "OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 57: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: mux_client_request_session: master session id: 2\r\nShared connection to minimaster.example.com closed.\r\n", "stdout": "---\r\ncurr_version: 3.1.1.6\r\navail_version: 3.1.0.4\r\n"}

TASK: [set_fact ] ************************************************************* 
<minimaster.example.com> ESTABLISH CONNECTION FOR USER: root
ok: [minimaster.example.com] => {"ansible_facts": {"g_aos_versions": {"avail_version": "3.1.0.4", "curr_version": "3.1.1.6"}}}

TASK: [set_fact ] ************************************************************* 
<minimaster.example.com> ESTABLISH CONNECTION FOR USER: root
ok: [minimaster.example.com] => {"ansible_facts": {"g_new_version": "3.1.0.4"}}

TASK: [set_fact ] ************************************************************* 
skipping: [minimaster.example.com]

TASK: [set_fact ] ************************************************************* 
<minimaster.example.com> ESTABLISH CONNECTION FOR USER: root
ok: [minimaster.example.com] => {"ansible_facts": {"g_new_version": "3.2.0.1"}}

TASK: [fail ] ***************************************************************** 
skipping: [minimaster.example.com]

<--snip---->
<--snip---->

TASK: [fail ] ***************************************************************** 
<minimaster.example.com> ESTABLISH CONNECTION FOR USER: root
failed: [minimaster.example.com] => {"failed": true}
msg: Upgrade packages not found

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/root/upgrade.retry

localhost                  : ok=7    changed=0    unreachable=0    failed=0   
minimaster.example.com     : ok=44   changed=4    unreachable=0    failed=1 

Expected Result:
It should assure the g_new_version > curr_version

Additional info:

  - fail:
      msg: Upgrade packages not found
    when: (g_aos_versions.avail_version | default(g_aos_versions.curr_version, true) | version_compare(target_version, '<'))

Expected results:


Additional info:

Comment 1 Brenton Leanhardt 2016-03-14 17:45:48 UTC
https://github.com/openshift/openshift-ansible/pull/1597

Comment 3 Anping Li 2016-03-15 11:23:52 UTC
Verified and pass.

Comment 5 errata-xmlrpc 2016-05-12 16:32:32 UTC
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/RHSA-2016:1064