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

feature request: network create does not have "--label" #5376

Closed
medyagh opened this issue Mar 2, 2020 · 14 comments
Closed

feature request: network create does not have "--label" #5376

medyagh opened this issue Mar 2, 2020 · 14 comments
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@medyagh
Copy link

medyagh commented Mar 2, 2020

in minikube we recently added podman as a driver, however we can not create a network with a label like for docker.

the reason for creating a network with a label is, minikube delete should be able to clean up after itself and delete all the created containers and networks.

 podman network create podman1

Flags:
      --disable-dns      disable dns plugin
  -d, --driver string    driver to manage the network (default "bridge")
      --gateway ip       IPv4 or IPv6 gateway for the subnet
      --internal         restrict external access from this network
      --ip-range ipNet   allocate container IP from range
      --macvlan string   create a Macvlan connection based on this device
      --subnet ipNet     subnet in CIDR format

is there any chance to match docker on this feature ?

Usage:	docker network create [OPTIONS] NETWORK

Create a network

Options:
      --attachable           Enable manual container attachment
      --aux-address map      Auxiliary IPv4 or IPv6 addresses used by Network driver (default map[])
      --config-from string   The network from which copying the configuration
      --config-only          Create a configuration only network
  -d, --driver string        Driver to manage the Network (default "bridge")
      --gateway strings      IPv4 or IPv6 Gateway for the master subnet
      --ingress              Create swarm routing-mesh network
      --internal             Restrict external access to the network
      --ip-range strings     Allocate container ip from a sub-range
      --ipam-driver string   IP Address Management Driver (default "default")
      --ipam-opt map         Set IPAM driver specific options (default map[])
      --ipv6                 Enable IPv6 networking
      --label list           Set metadata on a network
  -o, --opt map              Set driver specific options (default map[])
      --scope string         Control the network's scope
      --subnet strings       Subnet in CIDR format that represents a network segment
@medyagh medyagh changed the title network create does not have "--label" feature request: network create does not have "--label" Mar 2, 2020
@baude
Copy link
Member

baude commented Mar 3, 2020

is it not sufficient to podman network rm -f <name_of_network>?

@baude baude added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 3, 2020
@baude baude self-assigned this Mar 3, 2020
@github-actions
Copy link

github-actions bot commented Apr 3, 2020

A friendly reminder that this issue had no activity for 30 days.

@mheon
Copy link
Member

mheon commented Apr 3, 2020

Can you clarify the use case here a bit? Are you using labels and filtering with podman network ls --filter to identify what networks need to be removed?

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Apr 3, 2020
@rhatdan
Copy link
Member

rhatdan commented Apr 3, 2020

@kunalkushwaha Interested in working on this? @sujil02 ?

@hitchhooker
Copy link

hitchhooker commented May 4, 2020

Can you clarify the use case here a bit? Are you using labels and filtering with podman network ls --filter to identify what networks need to be removed?

podman network ls --filter does there even exist such flag as --filter for network? I keep receiving unknown flag error when trying to replace docker with podman for matrix-docker-ansible-deploy.

podman network ls -q --filter='name=^{{ matrix_podman_network }}$'
Error: unknown flag: --filter

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2020

@ParkerVR PTAL @baude Will help you out.

@mheon
Copy link
Member

mheon commented Jun 9, 2020

@rhatdan This one isn't going to be easy - basically going to need a complete rewrite of our network handling code.

@dougsland
Copy link
Contributor

Can you clarify the use case here a bit? Are you using labels and filtering with podman network ls --filter to identify what networks need to be removed?

podman network ls --filter does there even exist such flag as --filter for network? I keep receiving unknown flag error when trying to replace docker with podman for matrix-docker-ansible-deploy.

podman network ls -q --filter='name=^{{ matrix_podman_network }}$'
Error: unknown flag: --filter

@hitchhooker looks like it works for me.

# ./bin/podman network ls --filter name=podman 
NAME    VERSION  PLUGINS
podman  0.4.0    bridge,portmap,firewall,tuning
 ./bin/podman version
Version:      2.1.0-dev
API Version:  1
Go Version:   go1.13.6
Git Commit:   11e237bc3a6ab7ccb3a05ea5ffb1b6b046c1bac3-dirty
Built:        Sun Jun 21 07:01:57 2020
OS/Arch:      linux/amd64

@dougsland
Copy link
Contributor

@mheon @rhatdan how can I help in this one?

@rhatdan
Copy link
Member

rhatdan commented Jun 22, 2020

Need @mheon advise on this one.

@mheon
Copy link
Member

mheon commented Jun 22, 2020

This basically needs a full rewrite of how we handle networking, to store networks we create inside Libpod's database instead of using CNI config files as the sole source of truth (or CNI needs to add a labels field to their configs, which given our past interactions with them on feature requests, seems highly unlikely). There are cards already created for this, I think @baude wants me on it next sprint.

@rhatdan
Copy link
Member

rhatdan commented Sep 10, 2020

I don't think we have made any progress on this

@Luap99 Luap99 added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Nov 28, 2020
@medyagh
Copy link
Author

medyagh commented Nov 30, 2020

is it not sufficient to podman network rm -f <name_of_network>?

Unfortunately No, because we wouldn't know if that network was created by our tool (in this case minikube) or by the user manually. and minikube doesn't wanna accidentally delete user's created networks in the clean up process. so we rely on a specific label we set on the network to mark them as created by minikube

docker has this feature and we expected to treat podman exactly like docker when interacting with cli.

@Luap99
Copy link
Member

Luap99 commented Dec 2, 2020

Fixed in #8505

@Luap99 Luap99 closed this as completed Dec 2, 2020
@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
Good First Issue This issue would be a good issue for a first time contributor to undertake. In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

8 participants