Skip to content

Conversation

@klihub
Copy link
Contributor

@klihub klihub commented Nov 20, 2025

This slipped through our review...

Add minimum version check unit test for IntelRdt. Fix check to require 1.1.0 if at least one of the global or device specific container edits use IntelRdt.

@klihub klihub requested review from bart0sh, elezar and marquiz November 20, 2025 08:33
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
}

for _, v := range cache.ListVendors() {
for _, s := range cache.GetVendorSpecs(v) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see this nested loop in other places as well. Would it make sense to wrap it in function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean something like

// ForeachSpec iterates through all Specs by vendor, calling the given
// callback function for every Spec. It stops iterating early if the function
// returns true.
func ForeachSpec(fn func(spec *cdi.Spec) bool) {
    for _, v := range cache.ListVendors() {
        for _, s := range cache.GetVendorSpecs(v) {
            done := fn(s)
            if done {
                return
            } 
        }
    }
}

I'm fine doing that, but if we decide so then let's do it in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is what I was thinking about. I'm ok with doing it in a separate PR if you think it makes sense to do.

Copy link
Contributor

@bart0sh bart0sh left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Thanks @klihub

How's the netdevice stuff related to this? Shouldn't those be a separate PR (or then adjust the PR title and summary accordingly)?

nit: one commit message title s/minumum/minimum/

}
}

for _, dev := range spec.Devices {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch @klihub. Thanks.

@klihub klihub force-pushed the fixes/rdt-minimum-version-checl branch from 40d236b to 8efc0ff Compare November 20, 2025 12:17
@klihub
Copy link
Contributor Author

klihub commented Nov 20, 2025

Thanks @klihub

How's the netdevice stuff related to this? Shouldn't those be a separate PR (or then adjust the PR title and summary accordingly)?

@marquiz Argh, it is not related otherwise than me having those stacked on the same branch because they need to touch the same function in specs-go/version.go. I just I accidentally pushed the full commit stack to this branch, too. Fixed that now.

nit: one commit message title s/minumum/minimum/

Thanks for spotting it. Fixed that one, too.

Require 1.1.0 if at least one of the global or device specific
container edits use IntelRdt.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@elezar elezar merged commit 139ffec into cncf-tags:main Nov 20, 2025
8 checks passed
@klihub klihub deleted the fixes/rdt-minimum-version-checl branch November 21, 2025 06: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.

4 participants