Skip to content

Commit

Permalink
Issue argoproj#33: fix force-upgrade semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Zhang authored and wokeGit committed Nov 20, 2017
1 parent db1077e commit 03822af
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions common/python/ax/cluster_management/app/cluster_upgrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,22 @@ def run(self):
upgrade_service = True

if self._cfg.target_software_info.kube_installer_version == self._current_software_info.kube_installer_version \
and self._cfg.target_software_info.kube_version == self._current_software_info.kube_version:
and self._cfg.target_software_info.kube_version == self._current_software_info.kube_version \
and not self._cfg.force_upgrade:
upgrade_kube = False

if self._cfg.target_software_info.image_namespace == self._current_software_info.image_namespace \
and self._cfg.target_software_info.image_version == self._current_software_info.image_version \
and self._cfg.target_software_info.image_version != "latest" \
and not upgrade_kube:
and not upgrade_kube \
and not self._cfg.force_upgrade:
upgrade_service = False

if not upgrade_service and not upgrade_kube and not self._cfg.force_upgrade:
if not upgrade_service and not upgrade_kube:
logger.info("%sCluster's software versions is not changed, not performing upgrade.%s", COLOR_GREEN, COLOR_NORM)
logger.info("%sIf you want to force upgrade cluster, please specify --force-upgrade flag.%s", COLOR_YELLOW, COLOR_NORM)
return


if self._cfg.dry_run:
logger.info("DRY RUN: upgrading cluster %s", self._name_id)
return
Expand Down

0 comments on commit 03822af

Please sign in to comment.