code: func getServiceProtocols(spec corev1.ServiceSpec) map[string]string {
  	result := make(map[string]string)
  	for _, servicePort := range spec.Ports {
  		// Empty protocol must be defaulted (TCP)
  		if len(servicePort.Protocol) == 0 {
  			servicePort.Protocol = corev1.ProtocolTCP
  		}
  		result[strconv.Itoa(int(servicePort.Port))] = string(servicePort.Protocol)
  	}
  	return result
  }
docs: // Extracts the protocols exposed by a service from the given service spec.