WithServicePort adds a port to the current service
(value *corev1.ServicePort)
| 80 | |
| 81 | // WithServicePort adds a port to the current service |
| 82 | func (builder *Builder) WithServicePort(value *corev1.ServicePort) *Builder { |
| 83 | for idx, port := range builder.status.Spec.Ports { |
| 84 | if port.Name == value.Name { |
| 85 | builder.status.Spec.Ports[idx] = *value |
| 86 | return builder |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | builder.status.Spec.Ports = append(builder.status.Spec.Ports, *value) |
| 91 | return builder |
| 92 | } |
| 93 | |
| 94 | // WithServicePortNoOverwrite adds a ServicePort to the current service if no ServicePort that matches the name |
| 95 | // or port value is found |
no outgoing calls
no test coverage detected