Skip to content

Add a modifier factory#1655

Merged
elezar merged 4 commits intoNVIDIA:mainfrom
elezar:refactor-add-modifier-factory
Feb 17, 2026
Merged

Add a modifier factory#1655
elezar merged 4 commits intoNVIDIA:mainfrom
elezar:refactor-add-modifier-factory

Conversation

@elezar
Copy link
Member

@elezar elezar commented Feb 17, 2026

This change refactors modifier construction. It adds a Factory type which is used to encapsulate modifier construction. This means that it is not required to pass the same arguments (e.g. logger, driver, etc.) to each function for creating a specific modifier.

@elezar elezar requested review from jgehrcke and klueska February 17, 2026 08:48
@coveralls
Copy link

coveralls commented Feb 17, 2026

Pull Request Test Coverage Report for Build 22098416056

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 34 of 178 (19.1%) changed or added relevant lines in 11 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 38.964%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/modifier/list.go 0 1 0.0%
internal/modifier/hook_remover.go 0 2 0.0%
internal/modifier/graphics.go 0 10 0.0%
internal/modifier/csv.go 3 14 21.43%
internal/modifier/gated.go 0 17 0.0%
internal/modifier/mode.go 0 19 0.0%
internal/modifier/cdi.go 0 25 0.0%
internal/modifier/factory.go 18 77 23.38%
Totals Coverage Status
Change from base Build 22095413233: -0.2%
Covered Lines: 5700
Relevant Lines: 14629

💛 - Coveralls

@elezar elezar force-pushed the refactor-add-modifier-factory branch 3 times, most recently from e1ea57b to aa28656 Compare February 17, 2026 10:10
Copy link
Collaborator

@jgehrcke jgehrcke left a comment

Choose a reason for hiding this comment

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

I scrolled through the changes, and then I saw

Image

Is that new? Approved!

(the CI failure is certainly something you know how to interpret...)

@elezar elezar force-pushed the refactor-add-modifier-factory branch from 7138b63 to 53826e7 Compare February 17, 2026 10:43
@elezar
Copy link
Member Author

elezar commented Feb 17, 2026

Is that new? Approved!

Relatively, yes.

(the CI failure is certainly something you know how to interpret...)

The issue is that we're installing the rpmrebuild package from the epel repos and as of this morning there seems to be a glibc mismatch. I've added a commit on top to switch to a fedora:43 image to rebuild the packages to at least unblock the CI. (Created #1657 to track the CI fix separately).

@jgehrcke
Copy link
Collaborator

jgehrcke commented Feb 17, 2026

and as of this morning there seems to be a glibc mismatch

I see. Complex, real-world CI has so many moving targets.

@elezar elezar force-pushed the refactor-add-modifier-factory branch from 53826e7 to 6b16765 Compare February 17, 2026 10:52
@elezar
Copy link
Member Author

elezar commented Feb 17, 2026

and as of this morning there seems to be a glibc mismatch

I see. Complex, real-world CI has so many moving targets.

Looking into this a bit more deeply, I think it's related to the package posting for https://access.redhat.com/errata/RHSA-2026:2786 it seems as if the .i686 package is available on the repos but the .x86_64 packages are not.

This change adds a modifier.Factory that allows the options required
for constructing OCI spec modifiers to be encapsulated in a single
type instead of requiring that these be passed to every factory
function.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This change ensures that we expose the minimum public API from the
modifier package.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This change ensures that a modifier Factory also implements
the SpecModifier interface.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar force-pushed the refactor-add-modifier-factory branch from 6b16765 to 0e4ac09 Compare February 17, 2026 12:26
@elezar elezar merged commit 2c3090c into NVIDIA:main Feb 17, 2026
9 of 10 checks passed
@elezar elezar deleted the refactor-add-modifier-factory branch February 17, 2026 12:26
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.

3 participants