Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(minion): Fix version compare in minion.sls #419

Merged
merged 1 commit into from
Aug 25, 2019

Conversation

sticky-note
Copy link
Member

No description provided.

@sticky-note sticky-note force-pushed the fix/minion-version branch 2 times, most recently from 4e1a0b1 to e411732 Compare June 17, 2019 02:59
Copy link
Member

@noelmcloughlin noelmcloughlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @sticky-note

@daks
Copy link
Member

daks commented Jun 17, 2019

LGTM too, but Salt versions < 2017 are not supported anymore (cf https://s.saltstack.com/product-support-lifecycle/) so I think this patch is not useful.

@sticky-note
Copy link
Member Author

sticky-note commented Jun 17, 2019

@daks, @noelmcloughlin .. So we can also remove this entire test.
Without this patch, and with 2019.2.0, we are not matching to the
grains['saltversioninfo'][0] >= 2016 and grains['saltversioninfo'][1] >= 3 portion
which is not desirable according to the comments # old style, pre 2016.3. fork and disown the process and by the way, it doesn't work on FreeBSD 12 minions, version 2019.2.0.
What is the best thing to do ?

Copy link
Member

@myii myii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered by #416.

@sticky-note
Copy link
Member Author

sticky-note commented Aug 22, 2019

@myii @noelmcloughlin. I'll close this when #416 get merged but if it'll take time, can we merge this and rebase #416 with this modification ?

@noelmcloughlin
Copy link
Member

This is approved - Yes we should merge - comments can be addressed in #416

@myii
Copy link
Member

myii commented Aug 22, 2019

@sticky-note Let's improve this implementation and get this merged:

-  {%- if grains['saltversioninfo'][0] >= 2016 and grains['saltversioninfo'][1] >= 3 %}
+  {%- if grains['saltversioninfo'] > [2016, 3] %}

CC: @noelmcloughlin @daks.

@daks
Copy link
Member

daks commented Aug 22, 2019

@sticky-note Let's improve this implementation and get this merged:

-  {%- if grains['saltversioninfo'][0] >= 2016 and grains['saltversioninfo'][1] >= 3 %}
+  {%- if grains['saltversioninfo'] > [2016, 3] %}

CC: @noelmcloughlin @daks.

Do we want to support Salt < 2017? which itself is not supported par Saltstack itself?
If not, then no need to make any verification.

@myii
Copy link
Member

myii commented Aug 22, 2019

@daks I've actually removed the verification in #416 but that is stuck for merging right now. Others want this PR merged so I'm suggesting a cleaner solution for the meantime, even though it references older Salt versions for the time being.

@sticky-note
Copy link
Member Author

sticky-note commented Aug 22, 2019

supported par Saltstack

@daks You es French ? ^^

@myii Rebase done.
I've left the >= operator because we want 2016.3.0 to be matched by the test.
Is grains['saltversioninfo'] >= [ 2016, 3 ] equivalent with grains['saltversioninfo'][0] >= 2016 and grains['saltversioninfo'][1] >= 3

@myii
Copy link
Member

myii commented Aug 23, 2019

@sticky-note The following is sufficient by itself, no need for the 2017 clause:

-  {%- if grains['saltversioninfo'][0] >= 2017
-      or grains['saltversioninfo'] >= [ 2016, 3 ] %}
+  {%- if grains['saltversioninfo'] >= [2016, 3] %}

@sticky-note
Copy link
Member Author

sticky-note commented Aug 23, 2019

The PR is about that
-> version 2019.2.0 don't enter in the the condition grains['saltversioninfo'][0] >= 2016 and grains['saltversioninfo'][1] >= 3 because grains['saltversioninfo'][1] is less than 3. It is why i put this first condition.

@myii
Copy link
Member

myii commented Aug 23, 2019

The PR is about that
-> version 2019.2.0 don't enter in the the condition grains['saltversioninfo'][0] >= 2016 and grains['saltversioninfo'][1] >= 3 because grains['saltversioninfo'][1] is less than 3. It is why i put this first condition.

@sticky-note Forget the old method and try this by itself:

{%- if grains['saltversioninfo'] >= [2016, 3] %}

You'll find it works for 2019.2, etc.

@daks
Copy link
Member

daks commented Aug 23, 2019

@myii ok then.

@sticky-note yes

Copy link
Member

@myii myii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @sticky-note. I would have preferred it as [2016, 3] (without the extra spaces) but this should be fine for now.

@myii myii merged commit 23b2b7d into saltstack-formulas:master Aug 25, 2019
@sticky-note sticky-note deleted the fix/minion-version branch August 25, 2019 23:09
@saltstack-formulas-travis

🎉 This PR is included in version 0.58.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants