MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / setNRIPluginAnnotation

Function setNRIPluginAnnotation

controllers/object_controls.go:977–992  ·  view source on GitHub ↗
(o *metav1.ObjectMeta, cdiConfig *gpuv1.CDIConfigSpec, containerName string)

Source from the content-addressed store, hash-verified

975}
976
977func setNRIPluginAnnotation(o *metav1.ObjectMeta, cdiConfig *gpuv1.CDIConfigSpec, containerName string) {
978 const (
979 managementCDIDevice = "management.nvidia.com/gpu=all"
980 )
981
982 if !cdiConfig.IsNRIPluginEnabled() {
983 return
984 }
985 annotations := o.Annotations
986 if len(annotations) == 0 {
987 annotations = make(map[string]string)
988 }
989 annotationKey := fmt.Sprintf("%s/container.%s", NRIAnnotationDomain, containerName)
990 annotations[annotationKey] = managementCDIDevice
991 o.Annotations = annotations
992}
993
994func TransformDCGMExporterService(obj *corev1.Service, config *gpuv1.ClusterPolicySpec) error {
995 serviceConfig := config.DCGMExporter.ServiceSpec

Callers 7

TransformDevicePluginFunction · 0.85
TransformDCGMExporterFunction · 0.85
TransformDCGMFunction · 0.85
TransformMIGManagerFunction · 0.85
TransformValidatorFunction · 0.85

Calls 1

IsNRIPluginEnabledMethod · 0.80

Tested by

no test coverage detected