Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/hcsoci/devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (

const deviceUtilExeName = "device-util.exe"

// getAssignedDeviceKernelDrivers gets any device drivers specified on the spec.
// getSpecKernelDrivers gets any device drivers specified on the spec.
// Drivers are optional, therefore do not return an error if none are on the spec.
func getAssignedDeviceKernelDrivers(annotations map[string]string) ([]string, error) {
drivers := oci.ParseAnnotationCommaSeparated(oci.AnnotationAssignedDeviceKernelDrivers, annotations)
func getSpecKernelDrivers(annotations map[string]string) ([]string, error) {
drivers := oci.ParseAnnotationCommaSeparated(oci.AnnotationVirtualMachineKernelDrivers, annotations)
for _, driver := range drivers {
if _, err := os.Stat(driver); err != nil {
return nil, errors.Wrapf(err, "failed to find path to drivers at %s", driver)
Expand Down
2 changes: 1 addition & 1 deletion internal/hcsoci/resources_wcow.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func allocateWindowsResources(ctx context.Context, coi *createOptionsInternal, r

if coi.HostingSystem != nil {
// get the spec specified kernel drivers and install them on the UVM
drivers, err := getAssignedDeviceKernelDrivers(coi.Spec.Annotations)
drivers, err := getSpecKernelDrivers(coi.Spec.Annotations)
if err != nil {
return err
}
Expand Down
11 changes: 6 additions & 5 deletions internal/oci/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ const (
// AnnotationGPUVHDPath overrides the default path to search for the gpu vhd
AnnotationGPUVHDPath = "io.microsoft.lcow.gpuvhdpath"

// AnnotationAssignedDeviceKernelDrivers indicates what drivers to install in the pod during device
// assignment. This value should contain a list of comma separated directories containing all
// files and information needed to install given driver(s). This may include .sys,
// .inf, .cer, and/or other files used during standard installation with pnputil.
AnnotationAssignedDeviceKernelDrivers = "io.microsoft.assigneddevice.kerneldrivers"
// AnnotationVirtualMachineKernelDrivers indicates what drivers to install in the pod.
// This value should contain a list of comma separated directories containing all
// files and information needed to install given driver(s). For windows, this may
// include .sys, .inf, .cer, and/or other files used during standard installation with pnputil.
// For LCOW, this may include a vhd file that contains kernel modules as *.ko files.
AnnotationVirtualMachineKernelDrivers = "io.microsoft.virtualmachine.kerneldrivers"

// AnnotationDeviceExtensions contains a comma separated list of full paths to device extension files.
// The content of these are added to a container's hcs create document.
Expand Down
2 changes: 1 addition & 1 deletion test/cri-containerd/container_virtual_device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func getGPUContainerRequestWCOW(t *testing.T, podID string, podConfig *runtime.P
},
},
Annotations: map[string]string{
oci.AnnotationAssignedDeviceKernelDrivers: testDriversPath,
oci.AnnotationVirtualMachineKernelDrivers: testDriversPath,
},
},
PodSandboxId: podID,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.