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

Check capabilities in youki info subcommand #1389

Merged
merged 5 commits into from
Dec 7, 2022

Conversation

udzura
Copy link
Contributor

@udzura udzura commented Dec 1, 2022

Shows supported capabilities that started to be supported in recent kernel release.

At first I tried to call caps::drop() actually for each newly added caps, but it required privilege. So I just check these caps from default CapSet::Bounding.

@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2022

Codecov Report

Merging #1389 (7757267) into main (3a6d105) will decrease coverage by 0.14%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1389      +/-   ##
==========================================
- Coverage   68.80%   68.65%   -0.15%     
==========================================
  Files         119      119              
  Lines       12664    12692      +28     
==========================================
+ Hits         8713     8714       +1     
- Misses       3951     3978      +27     

@YJDoc2
Copy link
Collaborator

YJDoc2 commented Dec 1, 2022

Hey, the CI is failing due to a lint error
Also, is there any related issue/reasoning behind this? Particularly if we are printing the caps, why check only the newly supported ones for printing, why not all that are supported?

@YJDoc2
Copy link
Collaborator

YJDoc2 commented Dec 2, 2022

Also, is there any related issue/reasoning behind this? Particularly if we are printing the caps, why check only the newly supported ones for printing, why not all that are supported?

Hey @udzura apologies for the delay, but can you clarify the above? Apart from that this PR is good to go 👍

@udzura
Copy link
Contributor Author

udzura commented Dec 2, 2022

@YJDoc2

Apologies, just find the questions!

is there any related issue/reasoning behind this?

No, but if anything, I just encountered the same error as referred in #1349 . If youki info shows these capabilities, we can fix this kind of errors with much more ease.

why not all that are supported

I've considered this in advance, but I find there are so many capability flags to show in solo command. Maybe a special flag such as youki info --capabilities is required.

Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, Apologies, can I ask you for two small changes?

Comment on lines 230 to 232
"available"
} else {
"unsupported"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have either supported and unsupported or available and unavailable? I thought on it and it feels it'd be better if we have one of these two

@@ -223,6 +224,38 @@ pub fn print_namespaces() {
}
}

#[inline]
fn get_cap_supported(caps: &caps::CapsHashSet, cap: caps::Capability) -> &'static str {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename this to is_cap_supported oris_cap_available depending on how we are wording the output?

@YJDoc2
Copy link
Collaborator

YJDoc2 commented Dec 5, 2022

Hey @udzura , would it be possible for you to make the changes? If you are busy, I'd be happy to push a commit in this PR and merge. Please let me know :)

@udzura
Copy link
Contributor Author

udzura commented Dec 7, 2022

@YJDoc2 Very sorry for being late! I've applied suggestions.

Signed-off-by: Uchio Kondo <[email protected]>
Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍 Thanks for your contribution!

@YJDoc2 YJDoc2 merged commit a0ed8a7 into youki-dev:main Dec 7, 2022
@udzura udzura deleted the info-cap-avail branch December 7, 2022 06:21
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.

3 participants