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

Fixes #36741 - Check Ubuntu version more explicitly #9831

Conversation

bastian-src
Copy link
Contributor

@bastian-src bastian-src commented Sep 13, 2023

If no minor version is defined, the function minor.to_i makes it a "0". Accordingly, Ubuntu 20.04 is interpreted as "no subiquity/Autoinstall" - but, it should not assume a specific version here.

Therefore, is_subiquity should return ´true` in this case (especially, since all 20.04.x versions support subiquity/Autoinstall provisioning, but only specific ones allow Preseed/debian-installer still).

@theforeman-bot
Copy link
Member

Issues: #36741

If no minor version is defined, the function minor.to_i makes it a "0".
Accordingly, Ubuntu 20.04 is interpreted as "no subiquity/Autoinstall" - but,
if no minor version is given, Foreman should implicitly assume "latest"
(which supports Autoinstall in fact).
@bastian-src bastian-src force-pushed the fix_36741_ubuntu_version_interpretation branch from c1da492 to d4dbb9f Compare October 25, 2023 11:46
@bastian-src
Copy link
Contributor Author

@sbernhard I've just rebased to latest develop. Tests seem fine.

@ekohl
Copy link
Member

ekohl commented Oct 25, 2023

When is there ever not a minor?

@goarsna
Copy link
Contributor

goarsna commented Oct 26, 2023

Currently the official foreman documentation states, that if you create an Ubuntu operating system you should assign a major version (e.g. 20.04) and a minor version (e.g. 6). And I think this also is the case for the documentation of all other operating systems. So in most cases there should be a minor version set.

But there are cases where one might want to create an Ubuntu operating system without minor version. For example this is currently required for Host Registration of Ubuntu hosts, because the Fact parsers only provide information about the major version of Ubuntu to foreman (see my issue and the corresponding PR for reference). So for Host Registration to work, I have to create an Ubuntu operating system with major version 20.04 and empty minor version.
If I then provision a host using this Utbuntu 20.04 operating system, I won't be able to install the latest Ubuntu 20.04 wich is Ubuntu 20.04.6 as subiquity/autoinstall provisioning has to be used for it, but it won't be detected to be used.

This would be fixed by this change introduced by @bastian-src.

Copy link
Contributor

@sbernhard sbernhard left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@stejskalleos stejskalleos merged commit f109291 into theforeman:develop Dec 19, 2023
6 checks passed
nadjaheitmann pushed a commit to ATIX-AG/foreman that referenced this pull request Jan 10, 2024
@maximiliankolb maximiliankolb deleted the fix_36741_ubuntu_version_interpretation branch September 11, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants