-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
--format
and --filter
options for network ls
and network inspect
command
#6161
--format
and --filter
options for network ls
and network inspect
command
#6161
Conversation
It might be a good idea to add some test cases here https://github.com/containers/libpod/blob/master/test/e2e/network_test.go#L95 corresponding to new flags. |
Quick peruse LGTM. Need tests and also updates to |
03e0a4d
to
01f5ca2
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kunalkushwaha, rhatdan 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 |
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.
just a few nits that others may thumb wrestle with me over.
Otherwise LGTM
01f5ca2
to
90c63da
Compare
@rhatdan: Need further opinion. I might be wrong. Generally from what I have seen filters are usually applied lower on the stack bypassing the filter as params down. From how its done here filters for the network cannot be used by remote clients resulting in ambiguity in the responses. This can be considered a workaround in my opinion. |
@sujil02 Not sure what you are saying, But I believe the filtering should be taking place on the server side not in the client. |
Yeah, like said the filtering should be done on the server-side from how it's done here is client-side so the api for network list will not be able to implement filters as it is not bonded to the |
yes, I think this filter should be passing down. With the tunnel mode NetworkList hasn't been implemented yet, maybe for this PR is should pass to pkg/domain/infra/abi/network.go? |
Got it. I will move the filter code from cli to |
filter option helps to filter output based on name or supported plugins by CNI networks. Signed-off-by: Kunal Kushwaha <[email protected]>
This helps user to print the inspect output in go template format. Signed-off-by: Kunal Kushwaha <[email protected]>
New testcase for network ls --filter and inspect --format added. Also bash completion options updated. Signed-off-by: Kunal Kushwaha <[email protected]>
90c63da
to
087fdda
Compare
LGTM |
/lgtm |
/hold cancel |
This PR is for fixing bug #5205
This adds following options to network commands
podman network ls --filter
optionpodman network inspect --format
optionNOTE: Since the CNI conf file does not have defined structure and is read as read & stored as
map of interfaces
, its difficult to get similar output as ofdocker
as specified in #5205 (comment). until we create an internal structure. Which may not be good idea, as it may require to sync up with libcni code. Ideally, this structure should be defined in libcni code.PTAL: @medyagh @afbjorklund, If this helps your use case.