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

Add --if-not-exists option to podman network create #8987

Closed

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jan 16, 2021

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 #8842

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2021
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>
@Luap99 Luap99 force-pushed the network-create-if-not-exists branch from 91fbe78 to 1910185 Compare January 17, 2021 11:42
@rhatdan
Copy link
Member

rhatdan commented Jan 17, 2021

Bikeshedding a little, but I hate options with "-" embeded in them.

--ignore?
--exists?

@rhatdan
Copy link
Member

rhatdan commented Jan 18, 2021

Currently we have commands

podman image exists
podman pod exists
podman container exists

We should add
podman network exists
podman volume exists
podman manifest exists

Would that be better, then you could make a command like
podman network exists || podman network create ...

@vrothberg
Copy link
Member

Container/Pod creation also has a --replace flag which would remove existing objects in case of name conflicts.

@Luap99
Copy link
Member Author

Luap99 commented Jan 18, 2021

@vrothberg Replace behaviour is not wanted. see #8842

@Luap99
Copy link
Member Author

Luap99 commented Jan 18, 2021

@rhatdan I agree podman network exists would make sense.

@vrothberg
Copy link
Member

+1

@Luap99
Copy link
Member Author

Luap99 commented Jan 19, 2021

podman network exists PR #9021

@Luap99 Luap99 closed this Jan 19, 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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 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. 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.

4 participants