From a348d391037c5769d9f1f6d836cd70968258d989 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 16:52:47 +0000 Subject: [PATCH 1/2] chore(deps): bump tags.cncf.io/container-device-interface Bumps [tags.cncf.io/container-device-interface](https://github.com/cncf-tags/container-device-interface) from 0.8.1 to 1.0.0. - [Release notes](https://github.com/cncf-tags/container-device-interface/releases) - [Changelog](https://github.com/cncf-tags/container-device-interface/blob/main/RELEASE.md) - [Commits](https://github.com/cncf-tags/container-device-interface/compare/v0.8.1...v1.0.0) --- updated-dependencies: - dependency-name: tags.cncf.io/container-device-interface dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d0e4e5bdd7..4c5922762c 100644 --- a/go.mod +++ b/go.mod @@ -69,7 +69,7 @@ require ( gotest.tools v2.2.0+incompatible gotest.tools/v3 v3.5.2 mvdan.cc/sh/v3 v3.11.0 - tags.cncf.io/container-device-interface v0.8.1 + tags.cncf.io/container-device-interface v1.0.0 tags.cncf.io/container-device-interface/specs-go v1.0.0 ) diff --git a/go.sum b/go.sum index 7379b84ffe..b2eb77f485 100644 --- a/go.sum +++ b/go.sum @@ -751,7 +751,7 @@ mvdan.cc/sh/v3 v3.11.0/go.mod h1:LRM+1NjoYCzuq/WZ6y44x14YNAI0NK7FLPeQSaFagGg= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= -tags.cncf.io/container-device-interface v0.8.1 h1:c0jN4Mt6781jD67NdPajmZlD1qrqQyov/Xfoab37lj0= -tags.cncf.io/container-device-interface v0.8.1/go.mod h1:Apb7N4VdILW0EVdEMRYXIDVRZfNJZ+kmEUss2kRRQ6Y= +tags.cncf.io/container-device-interface v1.0.0 h1:fbwPQiWZNpXUb9Os6t6JW52rsOppTFUbeJOpNtN1TmI= +tags.cncf.io/container-device-interface v1.0.0/go.mod h1:mmi2aRGmOjK/6NR3TXjLpEIarOJ9qwgZjQ3nTIRwAaA= tags.cncf.io/container-device-interface/specs-go v1.0.0 h1:8gLw29hH1ZQP9K1YtAzpvkHCjjyIxHZYzBAvlQ+0vD8= tags.cncf.io/container-device-interface/specs-go v1.0.0/go.mod h1:u86hoFWqnh3hWz3esofRFKbI261bUlvUfLKGrDhJkgQ= From 5a3c319afc49f6aae8f4ffcdb3b38e03d27d7c58 Mon Sep 17 00:00:00 2001 From: David Trudgian Date: Wed, 12 Mar 2025 09:40:42 +0000 Subject: [PATCH 2/2] fix: make CDI mount check order-independent --- internal/pkg/runtime/launcher/oci/cdi_linux_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/pkg/runtime/launcher/oci/cdi_linux_test.go b/internal/pkg/runtime/launcher/oci/cdi_linux_test.go index db091d439e..38e08ad926 100644 --- a/internal/pkg/runtime/launcher/oci/cdi_linux_test.go +++ b/internal/pkg/runtime/launcher/oci/cdi_linux_test.go @@ -234,9 +234,10 @@ func Test_addCDIDevice(t *testing.T) { // We need this if-statement because the comparison below is done with reflection, and so a nil array and a non-nil but zero-length array will be considered different (which is not what we want here) if (len(tt.wantMounts) > 0) || (len(spec.Mounts) > 0) { - // Note that the current implementation of OCI/CDI sorts the mounts generated by the set of mapped devices, therefore we compare against a sorted list. + gotMounts := mountsList(spec.Mounts) + sort.Sort(gotMounts) sort.Sort(tt.wantMounts) - if !reflect.DeepEqual(mountsList(spec.Mounts), tt.wantMounts) { + if !reflect.DeepEqual(gotMounts, tt.wantMounts) { t.Errorf("addCDIDevices() mismatched mounts; expected %v, got %v.", tt.wantMounts, spec.Mounts) } }