Skip to content

Commit

Permalink
salt: Downgrade pre-check allow saltenv >= higher node
Browse files Browse the repository at this point in the history
Node version represent the version desired on a specific node and not
the actual deployed version so if for any reason a downgrade failed
after all node version being set to the destination one, we want to be
able to run the downgrade again so the saltenv specified may be higher
that all the node versions

Fixes: #2551
  • Loading branch information
TeddyAndrieux committed May 15, 2020
1 parent 19939ba commit ef22030
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion salt/metalk8s/orchestrate/downgrade/precheck.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set nodes_versions = pillar.metalk8s.nodes.values() | map(attribute='version') | list %}
{%- do nodes_versions.sort(cmp=salt.pkg.version_cmp, reverse=True) %}
{%- set expected = nodes_versions | first %}
{%- if saltenv != 'metalk8s-' ~ expected %}
{%- if salt.pkg.version_cmp(saltenv, 'metalk8s-' ~ expected) >= 0 %}

Invalid saltenv "{{ saltenv }}" consider using "metalk8s-{{ expected }}":
test.fail_without_changes
Expand Down

0 comments on commit ef22030

Please sign in to comment.