-
Notifications
You must be signed in to change notification settings - Fork 203
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
Libnetwork: Add IgnoreIfExists flag to network create method #1250
Conversation
This PR relates to the comment about Quadlet's support for It is the first step in adding this flag to Podman, the same way it was added for Volumes here: containers/podman#16243. |
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.
LGTM
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.
This cannot not be added to the network struct. The network struct is used all over the place (including netavark) , this option only applies to network create.
Can we catch the ErrNetworkExists error in podman instead?
@Luap99 I'll split my answer into two. |
Yes in theory we can handle it in libnetwork, but this a requires the change to be implement for every network backend which is possible but I don't really consider this a task the network backend should do. The important part is that the error is checked on the podman server side and not remote client. It does not need to happen inside libnetwork. Podman already blocks certain names here: https://github.com/containers/podman/blob/3f76f29adb070b3481843d33f75d05b8c8aebdfa/pkg/domain/infra/abi/network.go#L142-L145 I now also start to remember that I tried to do this a long time ago and it was decided against it, containers/podman#8842 Instead we agreed on |
Yes, I saw it too. But, again went with the layer in which it is handled for Volumes. I don't mind closing this PR and make the check there.
I see that the discussion started from both Network and Volume and for Volumes it was since added. So, why not add it for Network? I think that from the users' persprctive, having Podman support the |
Yes I am totally ok with adding --ignore, I just wanted to link old discussions here.
The only way to add it here is to break the interface to add a new parameter (or a new function). We do not guarantee a stable interface here AFAIK so that could work if you prefer to do it here. |
C/common isn't 1.0 yet, so we can, but @nalind usually gets annoyed when we break Buildah because things changed. One extra parameter shouldn't be that bad, though, and I don't know if Buildah actually creates networks - I think it just consumes them. |
Correct, buildah would not be effected by this. |
7ed9dc7
to
537f5a4
Compare
537f5a4
to
84930de
Compare
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.
LGTM
@Luap99 PTAL |
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 small comment, otherwise LGTM
Also before merging we need a ready to go podman PR with this change vendored to make sure we do not block others people work since you break the interface. |
Great call, Paul. I keep forgetting to ask for that unfortunately. @ygalblum, you can open the PR at Podman and vendor this (unmerged) PR here. You can use |
84930de
to
8963b08
Compare
@vrothberg is this containers/podman#16740 what you mean? |
yes, thank you! Looks like you need to run |
For now, only add IgnoreIfExists flag. Having this flag is very useful when using scripts or systemd unit files Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
8963b08
to
fcab41d
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, ygalblum 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 |
@vrothberg, @Luap99 I don't want to mess up Podman, so, please let me know what should the next steps be w.r.t this PR and the one in Podman |
Since containers/podman#16740 is green, you can drop a |
/hold cancel |
Having this flag is very useful when using scripts or systemd unit files
Signed-off-by: Ygal Blum ygal.blum@gmail.com