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

Error message needed when creating container in pod with -p option #7373

Closed
TomSweeneyRedHat opened this issue Aug 19, 2020 · 1 comment
Closed
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@TomSweeneyRedHat
Copy link
Member

Pulling this from a discussion by @Luap99 in #7364

IMO, we have to error on the podman create command. I've seen some people run into it and not realize the error.

This should not work:

$ podman pod create --name t1
$ podman create --pod t1 -p 8080:80 nginx

The create command should note the -p option when being used in a pod and at the very least issue a warning if not an error and disallow it totally.

@TomSweeneyRedHat TomSweeneyRedHat self-assigned this Aug 19, 2020
Luap99 added a commit to Luap99/libpod that referenced this issue Aug 20, 2020
Fixes: 4c75fe3 ("fix pod creation with "new:" syntax")

Commit 4c75fe3 passes all net options to the pod but forgot
to unset the options for the container creation. This leads to
erros when using flags like `--ip` since we tried setting
the ip on the pod and container which obviously fails.

I didn't notice the bug because we don't throw an error when
specifing port bindings on a container which joins the pods
network namespace. (containers#7373)

Also allow the use of `--hostname` and pass that option to the
pod and unset it for the container. The container has to use
the pods hostname anyway. This would error otherwise.

Added tests to prevent regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Luap99 added a commit to Luap99/libpod that referenced this issue Aug 20, 2020
Fixes: 4c75fe3 ("fix pod creation with "new:" syntax")

Commit 4c75fe3 passes all net options to the pod but forgot
to unset the options for the container creation. This leads to
erros when using flags like `--ip` since we tried setting
the ip on the pod and container which obviously fails.

I didn't notice the bug because we don't throw an error when
specifing port bindings on a container which joins the pods
network namespace. (containers#7373)

Also allow the use of `--hostname` and pass that option to the
pod and unset it for the container. The container has to use
the pods hostname anyway. This would error otherwise.

Added tests to prevent regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Luap99 added a commit to Luap99/libpod that referenced this issue Aug 20, 2020
Fixes: 4c75fe3 ("fix pod creation with "new:" syntax")

Commit 4c75fe3 passes all net options to the pod but forgot
to unset the options for the container creation. This leads to
erros when using flags like `--ip` since we tried setting
the ip on the pod and container which obviously fails.

I didn't notice the bug because we don't throw an error when
specifing port bindings on a container which joins the pods
network namespace. (containers#7373)

Also allow the use of `--hostname` and pass that option to the
pod and unset it for the container. The container has to use
the pods hostname anyway. This would error otherwise.

Added tests to prevent regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Luap99 added a commit to Luap99/libpod that referenced this issue Aug 20, 2020
Fixes: 4c75fe3 ("fix pod creation with "new:" syntax")

Commit 4c75fe3 passes all net options to the pod but forgot
to unset the options for the container creation. This leads to
erros when using flags like `--ip` since we tried setting
the ip on the pod and container which obviously fails.

I didn't notice the bug because we don't throw an error when
specifing port bindings on a container which joins the pods
network namespace. (containers#7373)

Also allow the use of `--hostname` and pass that option to the
pod and unset it for the container. The container has to use
the pods hostname anyway. This would error otherwise.

Added tests to prevent regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Luap99 added a commit to Luap99/libpod that referenced this issue Aug 20, 2020
Fixes: 4c75fe3 ("fix pod creation with "new:" syntax")

Commit 4c75fe3 passes all net options to the pod but forgot
to unset the options for the container creation. This leads to
erros when using flags like `--ip` since we tried setting
the ip on the pod and container which obviously fails.

I didn't notice the bug because we don't throw an error when
specifing port bindings on a container which joins the pods
network namespace. (containers#7373)

Also allow the use of `--hostname` and pass that option to the
pod and unset it for the container. The container has to use
the pods hostname anyway. This would error otherwise.

Added tests to prevent regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
mheon pushed a commit to mheon/libpod that referenced this issue Aug 20, 2020
Fixes: 4c75fe3 ("fix pod creation with "new:" syntax")

Commit 4c75fe3 passes all net options to the pod but forgot
to unset the options for the container creation. This leads to
erros when using flags like `--ip` since we tried setting
the ip on the pod and container which obviously fails.

I didn't notice the bug because we don't throw an error when
specifing port bindings on a container which joins the pods
network namespace. (containers#7373)

Also allow the use of `--hostname` and pass that option to the
pod and unset it for the container. The container has to use
the pods hostname anyway. This would error otherwise.

Added tests to prevent regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
@Luap99
Copy link
Member

Luap99 commented Sep 9, 2020

Closing since this got already fixed by #7390

@Luap99 Luap99 closed this as completed Sep 9, 2020
edsantiago pushed a commit to edsantiago/libpod that referenced this issue Sep 14, 2020
Fixes: 4c75fe3 ("fix pod creation with "new:" syntax")

Commit 4c75fe3 passes all net options to the pod but forgot
to unset the options for the container creation. This leads to
erros when using flags like `--ip` since we tried setting
the ip on the pod and container which obviously fails.

I didn't notice the bug because we don't throw an error when
specifing port bindings on a container which joins the pods
network namespace. (containers#7373)

Also allow the use of `--hostname` and pass that option to the
pod and unset it for the container. The container has to use
the pods hostname anyway. This would error otherwise.

Added tests to prevent regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
@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
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

2 participants