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 18, 2020
1 parent d200ee2 commit 41a3583
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion salt/metalk8s/orchestrate/downgrade/precheck.sls
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 | replace('metalk8s-', ''), expected) >= 0 %}

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

0 comments on commit 41a3583

Please sign in to comment.