Skip to content

Commit

Permalink
Add default port name for service
Browse files Browse the repository at this point in the history
  • Loading branch information
sonali-rajput committed May 4, 2023
1 parent 0c446fb commit 90a3635
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/configuration/base/resources/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ func UpdateService(actual corev1.Service, config v1alpha2.Service, targetPort in
}
actual.Spec.Ports[0].Port = config.Port
actual.Spec.Ports[0].TargetPort = intstr.IntOrString{IntVal: targetPort, Type: intstr.Int}
actual.Spec.Ports[0].Name = config.Portname
if config.Portname == "" {
actual.Spec.Ports[0].Name = "http"
} else {
actual.Spec.Ports[0].Name = config.Portname
}
if config.NodePort != 0 {
actual.Spec.Ports[0].NodePort = config.NodePort
}
Expand Down

0 comments on commit 90a3635

Please sign in to comment.