(o *metav1.ObjectMeta, cdiConfig *gpuv1.CDIConfigSpec, containerName string)
| 975 | } |
| 976 | |
| 977 | func 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 | |
| 994 | func TransformDCGMExporterService(obj *corev1.Service, config *gpuv1.ClusterPolicySpec) error { |
| 995 | serviceConfig := config.DCGMExporter.ServiceSpec |
no test coverage detected