Skip to content

Conversation

simonfelding
Copy link
Contributor

Description

Currently, if rke2_channel is defined and rke2_version is undefined (so we use the channel version for updating) then it fails with this error:

fatal: [node01]: FAILED! => {"msg": "The conditional check '(rke2_version_clean is version(running_version_clean, '>=')) or (rke2_version_clean is version(running_version_clean, '<') and rke2_allow_downgrade)\n' failed. The error was: Input version value cannot be empty"}

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Small minor change not affecting the Ansible Role code (GitHub Actions Workflow, Documentation etc.)

How Has This Been Tested?

I ran the code on my own cluster.

@simonfelding
Copy link
Contributor Author

It's not ready yet, it still seems to give:

fatal: [rancherkube01fl]: FAILED! => {"msg": "The conditional check '(rke2_version_clean is version(running_version_clean, '>=')) or (rke2_version_clean is version(running_version_clean, '<') and rke2_allow_downgrade)\n' failed. The error was: Input version value cannot be empty"}

@simonfelding simonfelding marked this pull request as ready for review August 11, 2025 07:38
@simonfelding
Copy link
Contributor Author

Now it works - tested ok on my cluster. @MonolithProjects

@MonolithProjects MonolithProjects self-assigned this Aug 29, 2025
@MonolithProjects MonolithProjects added the bug Something isn't working label Aug 29, 2025
@MonolithProjects
Copy link
Collaborator

@simonfelding rke2_version has a default value in the role defaults. This means it's always defined even if it's not defined in your playbook.

@simonfelding
Copy link
Contributor Author

@simonfelding rke2_version has a default value in the role defaults. This means it's always defined even if it's not defined in your playbook.

Yes, you need to set rke2_version: "" if you want to use rke2_channel, otherwise the rke2_version takes priority. This should probably be documented better in the docs

…anymore. has the added bonus effect of not doing the "Rolling cordon and drain restart when version changes " every time, if you use channel. has the "advantage" of now preferring channel over rke2_version, meaning the default value doesn't have to be updated.
@simonfelding
Copy link
Contributor Author

simonfelding commented Sep 3, 2025

I made a new patch that makes everything simpler.

Now you don't need to think about channel anymore when coding checks for version. It has the added bonus effect of not doing the "Rolling cordon and drain restart when version changes" tasks every time when you use channel. Also has the advantage of now preferring channel over rke2_version, meaning the default value doesn't have to be updated, as well has working with the existing code for avoiding downgrades (and future code that relies on rke2_version).

The downside is that this may cause people to have their clusters upgraded to "stable", as that is the default channel value which now overrides the rke2_version value.

@simonfelding
Copy link
Contributor Author

I think it's better to uncomment the rke2_channel version by default so we don't surprise anyone who didn't realize that rke2_version previously meant you ignore rke2_channel.

@simonfelding
Copy link
Contributor Author

simonfelding commented Sep 3, 2025

I'm done testing it, works as expected :) As a user, I'm really enjoying this. My tests run much faster now.

@simonfelding simonfelding changed the title The script fails if rke2_channel is set and rke2_version is undefined When rke2_channel is defined, set rke2_version to the latest version from there Sep 3, 2025
@MonolithProjects
Copy link
Collaborator

Hi @simonfelding. Thx, it is a nice feature. However I guess it would be better if the latest version from the selected channel would be used only if the variable rke2_version is ommited.

@MonolithProjects MonolithProjects added enhancement New feature or request and removed bug Something isn't working labels Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants