Repository navigation
New-app: Expose ports specified in source Dockerfile - #3201
Conversation
|
@deads2k fyi -- adding a test |
da97321 to
9128753
Compare
|
test added |
9128753 to
a38b8da
Compare
|
[test] |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/3268/) |
There was a problem hiding this comment.
An observation about the code. It's really difficult to know which parts of the objects are supposed to be valid at any given point in time. The ComponentReference holds a ComponentInput which could contain this information as early as the componentsForRepos step, but the ComponentInput gets stomped again during the Resolve step.
Having this change here means that even after Resolve is finished, the ComponentInput is incomplete. I think the ComponentInput is getting mutated here via series of navigated references, but I'm not completely certain. If so, it feels a little weird to have something called buildPipelines change an input object.
There was a problem hiding this comment.
Having this change here means that even after Resolve is finished, the ComponentInput is incomplete. I think the ComponentInput is getting mutated here via series of navigated references, but I'm not completely certain. If so, it feels a little weird to have something called buildPipelines change an input object.
Not quite. So the input image ref is created here in this method (using ref.Input().Match as the input) https://github.com/csrwng/origin/blob/newapp_dockerfile_ports/pkg/generate/app/cmd/newapp.go#L403, and we're simply mutating that created imageref.
Having said that, I agree that it is hard to follow what objects are available at what time. A restructuring and maybe a refactor to a more functional style of code here with immutable inputs/outputs would be great. But that won't happen right now :-)
There was a problem hiding this comment.
Port detection was previously happening while in source detection (removed by this PR). We should restore it somewhere there and not so late in the new-app flow.
There was a problem hiding this comment.
Port detection was previously happening while in source detection (removed by this PR). We should restore it somewhere there and not so late in the new-app flow.
An issue describing what we'd like to achieve in a refactor would be sufficient for me. I tried to make this modification myself, but after spending an hour in the code, I couldn't figure out where to do it. My changes kept getting stomped.
There was a problem hiding this comment.
Port detection was previously happening while in source detection (removed by this PR). We should restore it somewhere there and not so late in the new-app flow.
We still get the data during source detection (populated Dockerfile). However, the flow is different now since we do a resolve step which wasn't happening before.
There was a problem hiding this comment.
An issue describing what we'd like to achieve in a refactor would be sufficient for me. I tried to make this modification myself, but after spending an hour in the code, I couldn't figure out where to do it. My changes kept getting stomped.
|
This isn't handling multiple ports exposed on the same line: is producing |
|
It's a feature :) |
|
The container in the deployment config, however, should include all ports |
Why would I want that? If I have explicitly said in my |
|
Take my case as a for instance. nfs requires more than one port, so I've exposed them in my Dockerfile, but I can't use new-app because it only exposes one. |
|
The thinking is that you could expose more if you like via the |
That's certainly a recovery option, but I think the default should be full exposure. The author exposed them for a reason and it's easier for people to edit and delete than to edit and create. |
a38b8da to
f0ccc3b
Compare
|
rebased. @smarterclayton @deads2k - this one should be ready to go in |
|
lgtm. Will take multiple ports as a separate pull. [merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/3268/) (Image: devenv-fedora_1862) |
f0ccc3b to
2da4e06
Compare
|
trying again... [merge] |
|
re[merge] |
|
hmm, haven't seen this one before... |
|
Web driver flake. There's an issue open to investigate replacing with headless chrome |
|
[merge] again |
|
Evaluated for origin up to 2da4e06 |
Merged by openshift-bot
Fixes #3192