diff --git a/internal/hcsoci/devices.go b/internal/hcsoci/devices.go index 89dfe1a157..08c2ddae25 100644 --- a/internal/hcsoci/devices.go +++ b/internal/hcsoci/devices.go @@ -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) diff --git a/internal/hcsoci/resources_wcow.go b/internal/hcsoci/resources_wcow.go index 84240406c3..adfaee786a 100644 --- a/internal/hcsoci/resources_wcow.go +++ b/internal/hcsoci/resources_wcow.go @@ -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 } diff --git a/internal/oci/annotations.go b/internal/oci/annotations.go index bff3740512..5c28ea02c6 100644 --- a/internal/oci/annotations.go +++ b/internal/oci/annotations.go @@ -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. diff --git a/test/cri-containerd/container_virtual_device_test.go b/test/cri-containerd/container_virtual_device_test.go index cc7697ee86..bf7290c9cf 100644 --- a/test/cri-containerd/container_virtual_device_test.go +++ b/test/cri-containerd/container_virtual_device_test.go @@ -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, diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go index 89dfe1a157..08c2ddae25 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go @@ -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) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_wcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_wcow.go index 84240406c3..adfaee786a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_wcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_wcow.go @@ -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 } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/annotations.go b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/annotations.go index bff3740512..5c28ea02c6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/annotations.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/annotations.go @@ -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.