code: func GetMasterServiceUpdateIfNeeded(svc *corev1.Service, servicePorts []corev1.ServicePort, serviceType corev1.ServiceType) (s *corev1.Service, updated bool) {
  	// Determine if the service is in the format we expect
  	// (servicePorts are present and service type matches)
  	formatCorrect := checkServiceFormat(svc, servicePorts, serviceType)
  	if formatCorrect {
  		return svc, false
  	}
  	svc.Spec.Ports = servicePorts
  	svc.Spec.Type = serviceType
  	return svc, true
  }
docs: // GetMasterServiceUpdateIfNeeded sets service attributes for the
  //     given apiserver service.
  // * GetMasterServiceUpdateIfNeeded expects that the service object it
  //     manages will be managed only by GetMasterServiceUpdateIfNeeded;
  //     therefore, to understand this, you need only understand the
  //     requirements and the body of this function.
  // * GetMasterServiceUpdateIfNeeded ensures that the correct ports are
  //     are set.
  //
  // Requirements:
  // * All apiservers MUST use GetMasterServiceUpdateIfNeeded and only
  //     GetMasterServiceUpdateIfNeeded to manage service attributes
  // * updateMasterService is called periodically from all apiservers.