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

Support EXPOSE with port ranges #12305

Merged

Conversation

colinbendell
Copy link
Contributor

Fixes issue #12293. EXPOSE directive in images should mirror the --expose parameter. Specifically EXPOSE 20000-20100/tcp should work the sameas --expose 20000-20100/tcp

Signed-off-by: Colin Bendell [email protected]

What this PR does / why we need it:

Reuses the specgenutil.CreateExpose logic for parsing --expose parameters when parsing EXPOSE image directives.

How to verify it

  1. Dockerfile with:
FROM alpine
EXPOSE 20000-20100
  1. podman build --tag portrangetest .
  2. podman run --rm -it -P portrangetest

Which issue(s) this PR fixes:

Fixes #12293

Special notes for your reviewer:

@rhatdan
Copy link
Member

rhatdan commented Nov 15, 2021

LGTM
But could you add a test.
/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 15, 2021
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM but we need a regression test. Can you add a test to https://github.com/containers/podman/blob/main/test/e2e/run_networking_test.go?

@TomSweeneyRedHat
Copy link
Member

Code LTGM, as others have noted, a new test is needed.

@mheon
Copy link
Member

mheon commented Nov 15, 2021

I'll drop an LGTM for the record

@colinbendell colinbendell force-pushed the add-expose-port-range branch 2 times, most recently from 913015b to e6299a8 Compare November 18, 2021 12:16
@rhatdan
Copy link
Member

rhatdan commented Nov 18, 2021

/lgtm
/hold
You can hold cancel if the tests passes
Thanks @colinbendell

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 18, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 18, 2021
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

I do not think the test works at the moment, you also have to check the container ports

test/e2e/run_networking_test.go Outdated Show resolved Hide resolved
test/e2e/run_networking_test.go Outdated Show resolved Hide resolved
@Luap99
Copy link
Member

Luap99 commented Nov 18, 2021

@colinbendell Note that CI test are failing at the moment for unrelated reasons, see #12343.

@Luap99 Luap99 removed the lgtm Indicates that a PR is ready to be merged. label Nov 18, 2021
Fixes issue containers#12293. EXPOSE directive in images should mirror the --expose
parameter. Specifically `EXPOSE 20000-20100/tcp` should work the same
as `--expose 20000-20100/tcp`

Signed-off-by: Colin Bendell <[email protected]>
@colinbendell colinbendell force-pushed the add-expose-port-range branch 2 times, most recently from 5dff093 to 0cfa255 Compare November 21, 2021 01:04
Signed-off-by: Colin Bendell <[email protected]>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: colinbendell, Luap99, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Luap99
Copy link
Member

Luap99 commented Nov 21, 2021

/lgtm
/hold

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 21, 2021
@colinbendell
Copy link
Contributor Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2021

@colinbendell: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@colinbendell
Copy link
Contributor Author

Should I just re-run the sys remote fedora-34 root host test? The error seems unrelated to the PR?

[+0572s] # Error: failed to make pod: unable to create pod cgroup for pod 5aec4baf6b07a276909507d5df49243f808a26e5138dcaa82d4866da80a7817a: error creating cgroup machine.slice/machine-libpod_pod_5aec4baf6b07a276909507d5df49243f808a26e5138dcaa82d4866da80a7817a.slice: dial unix /run/systemd/private: connect: permission denied

@colinbendell
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 21, 2021
@openshift-merge-robot openshift-merge-robot merged commit 2f6cdd3 into containers:main Nov 21, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EXPOSE does not support port ranges
6 participants