Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support assign nodeport port in labels #1210

Merged
merged 5 commits into from
Dec 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix ci
  • Loading branch information
hangyan committed Dec 26, 2019
commit 41b8fb5bd3b3df3af4d8c23fc0a38675eb1b1b23
6 changes: 1 addition & 5 deletions pkg/transformer/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,6 @@ func (k *Kubernetes) ConfigServicePorts(name string, service kobject.ServiceConf
servicePorts := []api.ServicePort{}
seenPorts := make(map[int]struct{}, len(service.Port))

if len(service.Port) > 1 && service.NodePortPort != 0 {
log.Fatalf("Service %s has multiple ports and assigned node port value")
}

var servicePort api.ServicePort
for _, port := range service.Port {
if port.HostPort == 0 {
Expand All @@ -529,7 +525,7 @@ func (k *Kubernetes) ConfigServicePorts(name string, service kobject.ServiceConf
Port: port.HostPort,
TargetPort: targetPort,
}

if service.ServiceType == string(api.ServiceTypeNodePort) && service.NodePortPort != 0 {
servicePort.NodePort = service.NodePortPort
}
Expand Down