-
Notifications
You must be signed in to change notification settings - Fork 772
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
Add headless service type label #979
Conversation
close #851 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's my review!
docs/user-guide.md
Outdated
| kompose.service.expose | true / hostname | | ||
| kompose.service.expose.tls-secret | secret name | | ||
| kompose.volume.size | kubernetes supported volume size | | ||
|
||
**Note**: `kompose.service.type` label should be defined with `ports` only, otherwise `kompose` will fail. | ||
**Note**: `kompose.service.type` label should be defined with `ports` only(except for headless service), otherwise `kompose` will fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add spacing between only and (except)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!, thanks!
@@ -33,6 +33,9 @@ const ( | |||
LabelServiceExpose = "kompose.service.expose" | |||
// LabelServiceExposeTLSSecret provides the name of the TLS secret to use with the Kubernetes ingress controller | |||
LabelServiceExposeTLSSecret = "kompose.service.expose.tls-secret" | |||
|
|||
// ServiceTypeHeadless... | |||
ServiceTypeHeadless = "Headless" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most other variables are lowercase, should we use headless
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a special case. Since kubernetes api does not have a "Headless' type, it has api.ServiceTypeClusterIP=ClusterIP
.... This is var is only for internal use, others are custom labels that will show in the compose file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense.. This LGTM then!
if service.ExposeService != "" { | ||
objects = append(objects, o.initRoute(name, service, svc.Spec.Ports[0].Port)) | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use an else if
here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Thanks!
c9d0c17
to
7bc512a
Compare
Also remove the relation between restart and service create
20ba920
to
f3412a7
Compare
LGTM! 👍 |
Also remove the relation between restart and service create