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

Support device keys as `lxc list` columns #6275

Closed
itisnotdone opened this issue Oct 5, 2019 · 4 comments · Fixed by #6311

Comments

@itisnotdone
Copy link

commented Oct 5, 2019

It would be great if we can add custom columns for devices when using multiple virtual networks for multiple Envs.
For example, lxc list --columns devices.eth0.parent

I wasn't able to find any docs or use cases that explains it so I assume this could be a new feature.

@stgraber

This comment has been minimized.

Copy link
Member

commented Oct 5, 2019

That particular syntax would be a potential problem as we may one day introduce a devices namespace for config keys, which would then cause a conflict.

I think we'll want to switch the format to support both:

  • [config:]key[:name][:maxWidth}
  • devices:key[:name][:maxWidth}

So in your case, you'd be using: lxc list -c devices:eth0.parent

@stgraber stgraber changed the title LXD Feature Request: enable custom columns for devices Support device keys as `lxc list` columns Oct 5, 2019
@stgraber stgraber added this to the soon milestone Oct 5, 2019
@stgraber

This comment has been minimized.

Copy link
Member

commented Oct 5, 2019

This should be a pretty easy issue, especially as we already have testing in place for lxc list's current behavior. I expect someone interested in implementing this would need to:

  • Modify parseColumns in lxc/list.go to allow for the config:KEY:NAME:WIDTH: syntax
  • Add extra tests in lxc/list_test.go to test the config:KEY:NAME:WIDTH syntax and confirm nothing regressed
  • Add support for devices:KEY:NAME:WIDTH to parseColumns in lxc/list.go
  • Add more tests to lxc/list_test.go to validate support for devices:KEY:NAME:WIDTH
@srados

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2019

I could try to fix this one

@stgraber

This comment has been minimized.

Copy link
Member

commented Oct 8, 2019

Sure! Assigning it to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.