Skip to content

check-host-config: add RunOn filtering and re-enable modularity check#2213

Open
lzap wants to merge 6 commits intoosbuild:mainfrom
lzap:host-checks-4
Open

check-host-config: add RunOn filtering and re-enable modularity check#2213
lzap wants to merge 6 commits intoosbuild:mainfrom
lzap:host-checks-4

Conversation

@lzap
Copy link
Contributor

@lzap lzap commented Feb 18, 2026

Add a RunOn field to the Metadata struct and use it to filter checks
based on the OS ID and version. The RunOn field is a list of OS IDs to
run the check on (prefix with ! to exclude). The OS ID and version are
extracted from the /etc/os-release file.

Uses the functionality to only run modularity check on CentOS 9.


Also enables the modularity test and use filter to run it only on CentOS 9.

@lzap lzap requested a review from a team as a code owner February 18, 2026 15:15
@lzap lzap requested review from bcl, supakeen and thozza February 18, 2026 15:15
achilleas-k
achilleas-k previously approved these changes Feb 18, 2026
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

Very nice. Thank you!

LGTM

@achilleas-k achilleas-k linked an issue Feb 18, 2026 that may be closed by this pull request
@lzap
Copy link
Contributor Author

lzap commented Feb 19, 2026

Need to repro locally not sure how tho:

🔵 hostname: skip: no customizations
🔵 srv-masked: skip: no customizations
🔵 files: skip: no customizations
🔵 fw-ports: skip: no customizations
🔵 fw-srv-disabled: skip: no customizations
🔵 fw-srv-enabled: skip: no customizations
🔵 users: skip: no customizations
🔵 cacerts: skip: no customizations
🔵 directories: skip: no customizations
🔵 oscap: skip: no customizations
🔵 srv-disabled: skip: no customizations
🔵 srv-enabled: skip: no customizations
🔵 kernel: skip: temporarily disabled: https://github.com/osbuild/images/pull/2175
🔴 modularity: fail: module was not enabled: nodejs:18
Host check with config "modularity-enabled-modules.json" failed, return code 1

@lzap
Copy link
Contributor Author

lzap commented Feb 23, 2026

Added a test, incorporated @avitova comment. Also, I have found out that CentOS 9 Stream has slightly different output of dnf -q list modules --enabled, therefore the code was changed to dynamically detect start of the table. Finally, -y argument is added since @achilleas-k found out in osbuild/osbuild-composer#5008 that GPG key import can fail the command.

Finally, I consolidated the modularity test by using backtick strings instead of regular strings. This is in a separate commit. Bumped rngseed again to see tests passing hopefully now.

@avitova
Copy link
Contributor

avitova commented Feb 25, 2026

I am good here:)

lzap added 6 commits February 25, 2026 14:50
Add a RunOn field to the Metadata struct and use it to filter checks
based on the OS ID and version. The RunOn field is a list of OS IDs to
run the check on (prefix with `!` to exclude). The OS ID and version are
extracted from the /etc/os-release file.

Uses the functionality to only run modularity check on CentOS 9.
It looks like on some clouds (Azure), dnf can ask to import a key which
can be forced using -y option.
CentOS 9 dnf module list output is different from RHEL 9, so we need to
parse it differently. Instead of prefixed amount of headers, the check
now detects table rows dynamically. Tests will be updated in a follow-up
commit.
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.

Modularity check does not work

5 participants