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
Allow EXPOSE <number>/<protocol> in Dockerfile #17093
Allow EXPOSE <number>/<protocol> in Dockerfile #17093
Conversation
| for _, port := range dockerfileutil.LastExposedPorts(node) { | ||
| if _, err := strconv.ParseInt(port, 10, 32); err != nil { | ||
| return fmt.Errorf("could not parse %q: must be numeric", port) | ||
| errs := make([]string, 0) |
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.
Don't we already have parse function for PORT/PROTOCOL somewhere?
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
|
Added test for updated exposedPortsAreValid function |
|
/retest |
1 similar comment
|
/retest |
pkg/generate/app/cmd/newapp.go
Outdated
| errs := make([]string, 0) | ||
|
|
||
| if strings.HasPrefix(port, "$") { | ||
| errs = append(errs, "args are not currently supported for port numbers, did you mean to use config.AllowNonNumericExposedPorts?") |
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 don't know what config.AllowNonNumericExposedPorts is or how to set it. How will our users?
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 don't think they even can. it's an internal setting we set to true when invoking new-build)
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
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.
one nit and lgtm.
pkg/generate/app/cmd/newapp.go
Outdated
| errs := make([]string, 0) | ||
|
|
||
| if strings.HasPrefix(port, "$") { | ||
| errs = append(errs, "args are not currently supported for port numbers") |
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.
s/currently//
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.
corrected
|
/lgtm |
|
@bparees removed "currently" from the test |
|
/retest |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, coreydaley The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
Automatic merge from submit-queue (batch tested with PRs 17105, 17036, 17062, 17093). |
|
@coreydaley this needs a followup. If the port protocol is UDP then we need to setup the port on the container+service as such. (Currently I think it's always getting set as TCP). |
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1505558