-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Feature: --replace or else for "podman network create" and "podman volume create" #8842
Comments
Not sure what your goal here is? Are you looking to have a script that runs multiple times but does not know if the network was already created? Would $ errno -l | grep -i exis |
The goal is quite easy. podman containers will be started with systemd. For me it is only natural to do the network and volume creation the same way, alongside the containers. This is currently not achievable, since |
Couldn't you do something like ExecStartPre=podman network inspect FOOBAR > /dev/null || podman network create FOOBAR |
Sure, I can do this or provide a script or else. It just feels like a missing feature/a workaround/inconsistent, since:
|
Note that |
@Luap99 completely correct. This is how Having a proper switch for |
I opened #8987 to add |
If `--if-not-exists` is set `podman network create` will not error if the a network with the same given name already exists. This option is only supported for local podman client. Supporting the remote client would require changes in the api endpoint. This option can be used as `ExecStartPre` command in a systemd service file. see containers#8842 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
We now support |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
Creating new volumes or networks can be done via
podman volume create <name>
orpodman network create <name>
. This will fail, if<name>
already exists. For volumes, one can workaround this issue, sincepodman volume run -v <name>:/foo
will only create the volume, if it is not existing. For networks, this does not work.It would be awesome to see some cli additions, so
podman network create --replace <name>
orpodman network create --if-not.-exists <name>
can be used.Output of
podman version
:The text was updated successfully, but these errors were encountered: