fix(service): Fixes naming service ports
- ports should be named "port-XXX" with XXX to be the port number if the port name cannot be discovered - it follows what we do in Deployment objects - this should fix #132
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"katenary/utils"
|
||||
"regexp"
|
||||
"strings"
|
||||
@@ -59,6 +60,7 @@ func (s *Service) AddPort(port types.ServicePortConfig, serviceName ...string) {
|
||||
|
||||
if targetPort := utils.GetServiceNameByPort(int(port.Target)); targetPort == "" {
|
||||
finalport = intstr.FromInt(int(port.Target))
|
||||
name = fmt.Sprintf("port-%d", port.Target)
|
||||
} else {
|
||||
finalport = intstr.FromString(targetPort)
|
||||
name = targetPort
|
||||
|
Reference in New Issue
Block a user