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

expose service to outside, fix #140 #285

Merged
merged 1 commit into from
Dec 22, 2016

Conversation

concaf
Copy link
Contributor

@concaf concaf commented Nov 16, 2016

No description provided.

@cdrage
Copy link
Member

cdrage commented Nov 16, 2016

i think this needs rebasing, you've got some README.md changes in here.

@concaf
Copy link
Contributor Author

concaf commented Nov 17, 2016

@cdrage yeah, it's a WIP right now, things are going to get worse before it gets any better :)

@concaf concaf force-pushed the expose_service branch 2 times, most recently from ccbf4ef to 75e851f Compare November 17, 2016 09:26
@@ -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))
}
Copy link
Member

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).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@rtnpro
Copy link
Contributor

rtnpro commented Nov 28, 2016

@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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 7, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 34.872% when pulling f140667 on containscafeine:expose_service into 862419b on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.0%) to 33.024% when pulling 9a52fa6 on containscafeine:expose_service into 862419b on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.0%) to 33.024% when pulling 1a6946a on containscafeine:expose_service into 04a3131 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 33.617% when pulling 179c1af on containscafeine:expose_service into 04a3131 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 33.617% when pulling 4c22466 on containscafeine:expose_service into 04a3131 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.2%) to 32.707% when pulling 87f8884 on containscafeine:expose_service into 65e19e3 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+3.6%) to 38.576% when pulling d40fd99 on containscafeine:expose_service into 65e19e3 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+3.6%) to 38.576% when pulling 35302ef on containscafeine:expose_service into 65e19e3 on kubernetes-incubator:master.

@concaf concaf changed the title [WIP] expose service to outside, fix #140 expose service to outside, fix #140 Dec 14, 2016
},
}

//if exposeSlice := strings.Split(service.ExposeService, ":"); len(exposeSlice) == 2 {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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" {
Copy link
Member

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?

Copy link
Member

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

Copy link
Contributor Author

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)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay np :)

Copy link
Contributor Author

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)

@surajssd
Copy link
Member

@containscafeine please send docs with this, we don't want user to miss out on this cool feature due to lack of docs

@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 41.155% when pulling 190cf79 on containscafeine:expose_service into c485a87 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 41.155% when pulling 190cf79 on containscafeine:expose_service into c485a87 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.7%) to 40.157% when pulling 0c1fd72 on containscafeine:expose_service into c485a87 on kubernetes-incubator:master.

@cdrage
Copy link
Member

cdrage commented Dec 20, 2016

@containscafeine tests seem to fail since glide-vc --only-code --no-tests needs to be ran again in the directory for vendoring. missing one odd file.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.7%) to 40.157% when pulling 861f016 on containscafeine:expose_service into c485a87 on kubernetes-incubator:master.

@cdrage
Copy link
Member

cdrage commented Dec 20, 2016

commits need to be squashed and then LGTM from me :)

@coveralls
Copy link

Coverage Status

Coverage increased (+1.7%) to 40.157% when pulling 667f359 on containscafeine:expose_service into c485a87 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.7%) to 40.157% when pulling d14802f on containscafeine:expose_service into c485a87 on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.7%) to 40.157% when pulling d14802f on containscafeine:expose_service into c485a87 on kubernetes-incubator:master.

@concaf
Copy link
Contributor Author

concaf commented Dec 21, 2016

@cdrage @surajssd - added docs, squashed the commits, refactored the ingress unit test since last review. Should be good to go now.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.7%) to 40.157% when pulling 9654f28 on containscafeine:expose_service into c485a87 on kubernetes-incubator:master.

@cdrage
Copy link
Member

cdrage commented Dec 21, 2016

@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.
@coveralls
Copy link

Coverage Status

Coverage increased (+1.2%) to 42.083% when pulling 7e378cd on containscafeine:expose_service into 48e3ba8 on kubernetes-incubator:master.

@concaf
Copy link
Contributor Author

concaf commented Dec 21, 2016

@cdrage fixed

@surajssd
Copy link
Member

LGTM!

@surajssd surajssd merged commit 240f150 into kubernetes:master Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. review needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants