MCPcopy Index your code
hub / github.com/NVIDIA/gpu-operator / preprocessService

Function preprocessService

controllers/object_controls.go:707–726  ·  view source on GitHub ↗
(obj *corev1.Service, n ClusterPolicyController)

Source from the content-addressed store, hash-verified

705}
706
707func preprocessService(obj *corev1.Service, n ClusterPolicyController) error {
708 logger := n.logger.WithValues("Service", obj.Name)
709 transformations := map[string]func(*corev1.Service, *gpuv1.ClusterPolicySpec) error{
710 "nvidia-dcgm-exporter": TransformDCGMExporterService,
711 }
712
713 t, ok := transformations[obj.Name]
714 if !ok {
715 logger.V(2).Info(fmt.Sprintf("No transformation for Service '%s'", obj.Name))
716 return nil
717 }
718
719 err := t(obj, &n.singleton.Spec)
720 if err != nil {
721 logger.Error(err, "Failed to apply transformation", "Service", obj.Name)
722 return err
723 }
724
725 return nil
726}
727
728func preProcessDaemonSet(obj *appsv1.DaemonSet, n ClusterPolicyController) error {
729 logger := n.logger.WithValues("Daemonset", obj.Name)

Callers 1

ServiceFunction · 0.85

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected