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

CLI: Add container interfaces to show interfaces #783

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

rical
Copy link
Contributor

@rical rical commented Oct 29, 2024

Description

Add container support to show interfaces and operational data.

Output example

Here's an example where the containers are named "system" and "system2". Note that the peer is now printed for veth0a even though its peer veth0b is owned by the container system.
Screenshot from 2024-10-29 16-25-54

It's also possible to retrieve some information about a specific interface even when it's owned by a container.
Screenshot from 2024-10-29 16-26-25

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

rical added 2 commits October 29, 2024 17:22
There should be no functional change.
Make show interfaces container aware. This is done by looking though
all podman containers for interfaces and looking up there info from
network namespaces on the main system / hypervisor.

Interfaces controlled by containers are clearly marked in the "show
interfaces" output, with a single gray row. Telling the user that they
belong to one or more named containers. The user can then run "show
interface name NAME" on interfaces owned by containers, which provided
some additional info, such as mac address and stat counters.

The patch also add support for printing veth peers which are owned by
containers.

Lastly, the patch also adds test cases for this functionality.

Signed-off-by: Richard Alpe <richard@bit42.se>
@troglobit troglobit self-assigned this Oct 31, 2024
@troglobit troglobit added this to the Infix v24.10.2 milestone Oct 31, 2024
@troglobit troglobit merged commit 142eda8 into kernelkit:main Oct 31, 2024
4 checks passed
@troglobit troglobit linked an issue Nov 3, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cli: improve 'show interfaces' to list container networks
2 participants