-
Notifications
You must be signed in to change notification settings - Fork 760
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
expose service to outside, fix #140 #285
Conversation
18abca6
to
18b8e68
Compare
i think this needs rebasing, you've got some README.md changes in here. |
@cdrage yeah, it's a WIP right now, things are going to get worse before it gets any better :) |
ccbf4ef
to
75e851f
Compare
@@ -160,6 +184,10 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C | |||
objects = append(objects, svc) | |||
} | |||
|
|||
if service.ExposeService != "" { | |||
objects = append(objects, o.initRoute(name, service)) | |||
} |
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.
Also we can expose a service only if we can create a service in first place. So this if block should be inside if o.PortsExist(name, service)
.
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.
👍
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.
Fixed
75e851f
to
7cb5f97
Compare
@containscafeine I tested the example you have created and it seems to work correctly. I also had a look at the code. It looks good, overall. |
7cb5f97
to
f140667
Compare
9a52fa6
to
1a6946a
Compare
4c22466
to
87f8884
Compare
}, | ||
} | ||
|
||
//if exposeSlice := strings.Split(service.ExposeService, ":"); len(exposeSlice) == 2 { |
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.
are you planning to remove this?
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.
Yes, and will add some comments in the code in the next commit.
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.
Fixed
}, | ||
} | ||
|
||
if service.ExposeService != "true" { |
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.
is there a way that we enforce user to provide either "true" or a valid url?
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.
i am asking because what if user provides value as false
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.
In that case, false
gets treated as a hostname. If the user does not want to expose, he would rather not write (or comment) this in the compose file.
Even I am divided on this. Should we enforce, (true, false, hostname), or just (true, hostname)?
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.
okay np :)
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.
So went ahead with (true, hostname)
@containscafeine please send docs with this, we don't want user to miss out on this cool feature due to lack of docs |
35302ef
to
2a6effe
Compare
2a6effe
to
190cf79
Compare
@containscafeine tests seem to fail since |
commits need to be squashed and then LGTM from me :) |
9a4fbee
to
d14802f
Compare
d14802f
to
9654f28
Compare
@containscafeine just conflicting right now :) |
Implements a kompose specific docker compose label "kompose.service.expose" which can be used to expose the specified services externally. The accepted values are of type string. If the value is set to "true", the provider sets the endpoint automatically, and for any other value, the value is set as the hostname. If multiple ports are defined in a service, the first one is chosen to be the exposed. Unit tests, functional tests, glide updates and docs have also been added in this commit for the related feature.
9654f28
to
7e378cd
Compare
@cdrage fixed |
LGTM! |
No description provided.