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

container: T6208: rename "cap-add" CLI node to "capability" #3269

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

c-po
Copy link
Member

@c-po c-po commented Apr 6, 2024

Change Summary

Containers have the ability to add Linux system capabilities to them, this is done using the set container name <name> cap-add command.

The CLI node sounds off and rather should be set container name <name> capability instead as we use and pass a capability to a container and not add/invent new ones.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

container

Proposed changes

CLI migration

How to test

Updated smoketests

set container name c01 allow-host-networks
set container name c01 capability 'net-bind-service'
set container name c01 capability 'net-raw'
set container name c01 image 'busybox:stable'
set container name c02 allow-host-networks
set container name c02 capability 'sys-time'
set container name c02 image 'busybox:stable'

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Containers have the ability to add Linux system capabilities to them, this is
done using the "set container name <name> cap-add" command.

The CLI node sounds off and rather should be "set container name <name>
capability" instead as we use and pass a capability to a container and not
add/invent new ones.
@c-po
Copy link
Member Author

c-po commented Apr 6, 2024

@Mergifyio backport sagitta

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and sever-sever and removed request for a team April 6, 2024 19:09
Copy link
Contributor

mergify bot commented Apr 6, 2024

backport sagitta

✅ Backports have been created

@dmbaturin dmbaturin merged commit f124bab into vyos:current Apr 7, 2024
9 checks passed
@24fpsDaVinci
Copy link

I get this error running "set container name test capability 'net-bind-service'"

vyos@vyos# commit
[ container ]
VyOS had an issue completing a command.

We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):
- Contact us using the online help desk if you have a subscription:
  https://support.vyos.io/
- Make sure you are running the latest version of VyOS available at:
  https://vyos.net/get/
- Consult the community forum to see how to handle this issue:
  https://forum.vyos.io
- Join us on Slack where our users exchange help and advice:
  https://vyos.slack.com

When reporting problems, please include as much information as possible:
- do not obfuscate any data (feel free to contact us privately if your 
  business policy requires it)
- and include all the information presented below

Report time:      2024-04-06 23:18:59
Image version:    VyOS 1.5-rolling-202404070021
Release train:    current

Built by:         [email protected]
Built on:         Sun 07 Apr 2024 02:27 UTC
Build UUID:       b3b3bf01-665c-4d0e-b52f-97656c84ecfa
Build commit ID:  0c12b79fd8d13d

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  Gigabyte Technology Co., Ltd.
Hardware model:   H370 WIFI
Hardware S/N:     Default string
Hardware UUID:    

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/container.py", line 485, in <module>
    generate(c)
  File "/usr/libexec/vyos/conf_mode/container.py", line 413, in generate
    run_args = generate_run_arguments(name, container_config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/libexec/vyos/conf_mode/container.py", line 268, in generate_run_arguments
    cap = c.upper().replace('-', '_')
          ^^^^^^^
AttributeError: 'ConfigDict' object has no attribute 'upper'



[[container]] failed
Commit failed

c-po added a commit that referenced this pull request Apr 7, 2024
container: T6208: rename "cap-add" CLI node to "capability" (backport #3269)
@c-po
Copy link
Member Author

c-po commented Apr 7, 2024

Loops like with all the branch switches yesterday I installed the wrong package for testing. sorry! fix fill be there, asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants