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

Introduce new CPE platform for bootable containers #12519

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

jan-cerny
Copy link
Collaborator

This commit adds a new CPE platform bootc.

Matches:

  • bootc (RHEL Image Mode) containers and container images
  • running bootc (RHEL Image Mode) systems

Does not match:

  • classic containers and container images
  • normal bare-metal systems or VMs

The matching platforms and non-matching platforms can be easily distinguished by checking for presence of the kernel and rpm-ostree RPM packages. Bootable containers and running bootc systems both contain both these packages. Normal bare-metal systems usually don't have the rpm-ostree, normal containers don't contain kernel.

@jan-cerny jan-cerny added the Image Mode Bootable containers and Image Mode RHEL label Oct 18, 2024
@jan-cerny jan-cerny added this to the 0.1.75 milestone Oct 18, 2024
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@@ -0,0 +1,18 @@
name: cpe:/a:bootc
Copy link
Member

Choose a reason for hiding this comment

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

This also applies to other immutable OSes like Fedora Silverblue.

Should we rename to something like immutable?

@Mab879 Mab879 self-assigned this Oct 22, 2024
This commit adds a new CPE platform `bootc`.

Matches:
- bootc (RHEL Image Mode) containers and container images
- running bootc (RHEL Image Mode) systems

Does not match:
- classic containers and container images
- normal bare-metal systems or VMs

The matching platforms and non-matching platforms can be easily distinguished
by checking for presence of the kernel and rpm-ostree RPM packages.
Bootable containers and running bootc systems both contain both these packages.
Normal bare-metal systems usually don't have the rpm-ostree, normal
containers don't contain kernel.
The original definition would match other rpm-ostree based
platforms such as Fedora SilverBlue. With this change, we will
improve the platform definition so that it will match only the
bootable containers and running systems deployed from bootable
containers.
Change OVAL test IDs in the bootc platform CPE OVAL to prevent
ID collisions during the build.

Addressing:
CRITICAL: ERROR: it's not possible to use the same ID: inventory_test_kernel_installed for two semantically different OVAL entities
@jan-cerny
Copy link
Collaborator Author

I have rebased this PR on the top of the latest upstream master branch. I have extended the check to not match other immutable platforms and I have fixed the OVAL test IDs.

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Just one minor change.

shared/applicability/bootc.yml Outdated Show resolved Hide resolved
Copy link

codeclimate bot commented Oct 24, 2024

Code Climate has analyzed commit 1849ef6 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 60.9% (0.0% change).

View more on Code Climate.

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Thanks!

@Mab879 Mab879 merged commit 12604c7 into ComplianceAsCode:master Oct 24, 2024
101 of 104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Image Mode Bootable containers and Image Mode RHEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants