summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-02-14 13:09:41 -0800
committerGitHub <noreply@github.com>2018-02-14 13:09:41 -0800
commitdeb9a793cbb169b964424720f9c3a6ce6b976b09 (patch)
treea5bf67b272a8ba7829eb2ba0d3eaeface0909a32 /roles
parentb90ec246f78ac66c4251996f9bb288875765ccaf (diff)
parentcdb1ae5fd0057aa6b666ca53fc54e73ce8be19fa (diff)
downloadopenshift-deb9a793cbb169b964424720f9c3a6ce6b976b09.tar.gz
openshift-deb9a793cbb169b964424720f9c3a6ce6b976b09.tar.bz2
openshift-deb9a793cbb169b964424720f9c3a6ce6b976b09.tar.xz
openshift-deb9a793cbb169b964424720f9c3a6ce6b976b09.zip
Merge pull request #7124 from mgugino-upstream-stage/fix-version-multi
Automatic merge from submit-queue. Fix version multi Simplify double upgrade version logic Currently, double upgrade process (3.7 -> 3.9) for control plane attempts to run openshift_version role twice to set the appropriate values for upgrading each major version, 3.8 and 3.9. This commit instructs openshift_version to only inquire about the proper settings for 3.9, and hard-sets the appropriate values for 3.8. This allows a simplification of the openshift_version role, allowing for easier debugging. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1542368
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_version/defaults/main.yml4
-rw-r--r--roles/openshift_version/tasks/first_master.yml26
-rw-r--r--roles/openshift_version/tasks/first_master_containerized_version.yml6
-rw-r--r--roles/openshift_version/tasks/first_master_rpm_version.yml9
-rw-r--r--roles/openshift_version/tasks/masters_and_nodes.yml5
5 files changed, 27 insertions, 23 deletions
diff --git a/roles/openshift_version/defaults/main.yml b/roles/openshift_version/defaults/main.yml
index 513dff045..c807df9d3 100644
--- a/roles/openshift_version/defaults/main.yml
+++ b/roles/openshift_version/defaults/main.yml
@@ -10,4 +10,6 @@ openshift_service_type: "{{ openshift_service_type_dict[openshift_deployment_typ
openshift_use_crio_only: False
l_first_master_version_task_file: "{{ openshift_is_containerized | ternary('first_master_containerized_version.yml', 'first_master_rpm_version.yml') }}"
-l_force_image_tag_to_version: False
+
+# Used during double control plane upgrades.
+l_double_upgrade_cp_reset_version: False
diff --git a/roles/openshift_version/tasks/first_master.yml b/roles/openshift_version/tasks/first_master.yml
index b0d155c2c..022ac30fc 100644
--- a/roles/openshift_version/tasks/first_master.yml
+++ b/roles/openshift_version/tasks/first_master.yml
@@ -13,20 +13,30 @@
- include_tasks: "{{ l_first_master_version_task_file }}"
+# When double upgrade is in process, we want to set everything to match
+# openshift_verison.
- block:
- debug:
msg: "openshift_pkg_version was not defined. Falling back to -{{ openshift_version }}"
- set_fact:
- openshift_pkg_version: -{{ openshift_version }}
+ openshift_pkg_version: "-{{ openshift_version }}"
when:
- - openshift_pkg_version is not defined or openshift_pkg_version == ""
- - openshift_upgrade_target is not defined
+ - openshift_pkg_version is not defined or l_double_upgrade_cp_reset_version
+# When double upgrade is in process, we want to set everything to match
+# openshift_verison.
- block:
- debug:
- msg: "openshift_image_tag set to v{{ openshift_version }}"
+ msg: "openshift_image_tag was not defined. Falling back to v{{ openshift_version }}"
- set_fact:
- openshift_image_tag: v{{ openshift_version }}
- when: >
- openshift_image_tag is not defined or openshift_image_tag == ""
- or l_force_image_tag_to_version | bool
+ openshift_image_tag: "v{{ openshift_version }}"
+ when: openshift_image_tag is not defined or l_double_upgrade_cp_reset_version
+
+# The end result of these three variables is quite important so make sure they are displayed and logged:
+- debug: var=openshift_release
+
+- debug: var=openshift_image_tag
+
+- debug: var=openshift_pkg_version
+
+- debug: var=openshift_version
diff --git a/roles/openshift_version/tasks/first_master_containerized_version.yml b/roles/openshift_version/tasks/first_master_containerized_version.yml
index 9eb38cb2b..e02a75eab 100644
--- a/roles/openshift_version/tasks/first_master_containerized_version.yml
+++ b/roles/openshift_version/tasks/first_master_containerized_version.yml
@@ -6,9 +6,7 @@
openshift_version: "{{ openshift_image_tag[1:].split('-')[0] if openshift_image_tag != 'latest' else openshift_image_tag }}"
when:
- openshift_image_tag is defined
- - openshift_image_tag != ""
- openshift_version is not defined
- - not (openshift_version_reinit | default(false))
- name: Set containerized version to configure if openshift_release specified
set_fact:
@@ -22,7 +20,7 @@
docker run --rm {{ openshift_cli_image }}:latest version
register: cli_image_version
when:
- - openshift_version is not defined or openshift_version_reinit | default(false)
+ - openshift_version is not defined
- not openshift_use_crio_only
# Origin latest = pre-release version (i.e. v1.3.0-alpha.1-321-gb095e3a)
@@ -36,7 +34,7 @@
- set_fact:
openshift_version: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0][1:] }}"
- when: openshift_version is not defined or openshift_version_reinit | default(false)
+ when: openshift_version is not defined
# If we got an openshift_version like "3.2", lookup the latest 3.2 container version
# and use that value instead.
diff --git a/roles/openshift_version/tasks/first_master_rpm_version.yml b/roles/openshift_version/tasks/first_master_rpm_version.yml
index 85e440513..9a5f0c568 100644
--- a/roles/openshift_version/tasks/first_master_rpm_version.yml
+++ b/roles/openshift_version/tasks/first_master_rpm_version.yml
@@ -5,17 +5,14 @@
openshift_version: "{{ openshift_pkg_version[1:].split('-')[0] }}"
when:
- openshift_pkg_version is defined
- - openshift_pkg_version != ""
- openshift_version is not defined
- - not (openshift_version_reinit | default(false))
# These tasks should only be run against masters and nodes
- name: Set openshift_version for rpm installation
include_tasks: check_available_rpms.yml
+# If double upgrade is in process, we want to set openshift_version to whatever
+# rpm package is available.
- set_fact:
openshift_version: "{{ rpm_results.results.versions.available_versions.0 }}"
- when: openshift_version is not defined or ( openshift_version_reinit | default(false) )
-- set_fact:
- openshift_pkg_version: "-{{ rpm_results.results.versions.available_versions.0 }}"
- when: openshift_version_reinit | default(false)
+ when: openshift_version is not defined or l_double_upgrade_cp_reset_version
diff --git a/roles/openshift_version/tasks/masters_and_nodes.yml b/roles/openshift_version/tasks/masters_and_nodes.yml
index eddd5ff42..c4dbc2a5f 100644
--- a/roles/openshift_version/tasks/masters_and_nodes.yml
+++ b/roles/openshift_version/tasks/masters_and_nodes.yml
@@ -8,10 +8,7 @@
fail:
msg: "OCP rpm version {{ rpm_results.results.versions.available_versions.0 }} is different from OCP image version {{ openshift_version }}"
# Both versions have the same string representation
- when:
- - openshift_version not in rpm_results.results.versions.available_versions.0
- - openshift_version_reinit | default(false)
-
+ when: rpm_results.results.versions.available_versions.0 != openshift_version
# block when
when: not openshift_is_atomic | bool