-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add features structure type #184
Conversation
bb4c4f7
to
6f3e7e0
Compare
The CI has failed due to missing labels, and I don't have permission to add them. Could anyone look into it? Thanks. |
6f3e7e0
to
6ecc08b
Compare
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.
Thanks! Let's consider reusing the already-defined structures.
src/runtime/features.rs
Outdated
use getset::{Getters, MutGetters, Setters}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Features Structure that represents supported features of the runtime. |
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.
/// Features Structure that represents supported features of the runtime. | |
/// Features represents supported features of the runtime. |
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.
fixed in bb504b4
src/runtime/features.rs
Outdated
pub struct Linux { | ||
/// The list of the recognized namespaces, e.g., "mount". | ||
/// "None" means "unknown", not "no support for any namespace". | ||
namespaces: Option<Vec<String>>, |
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.
Can we use LinuxNamespaceType
?
https://github.com/musaprg/oci-spec-rs/blob/6ecc08b6f348c28cd769f3264356f08f95994d77/src/runtime/linux.rs#L805-L806
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.
fixed to reuse existing types in e247914
src/runtime/features.rs
Outdated
enabled: Option<bool>, | ||
actions: Option<Vec<String>>, | ||
operators: Option<Vec<String>>, | ||
archs: Option<Vec<String>>, |
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.
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.
I've added the missing ScmpArchRiscv64
to the Arch
enum.
You can check the value of SCMP_ARCH_RISCV64
(originally AUDIT_ARCH_RISCV64
) from the libseccomp source, or calculated values are available on the golang.org/x/sys/unix
package.
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.
fixed to reuse existing types in e247914
src/runtime/features.rs
Outdated
#[serde(rename_all = "camelCase")] | ||
pub struct Seccomp { | ||
enabled: Option<bool>, | ||
actions: Option<Vec<String>>, |
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.
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.
I've added ScmpActKillThread
into the LinuxSeccompAction
enum. It's equivalent to ScmpActKill
but needs to be defined explicitly to conform to the spec. I need to implement the From
trait for u32
because we cannot define multiple enum items with the same value 0x00000000
.
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.
fixed to reuse existing types in e247914
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.
Thanks! Let's consider reusing the already-defined structures.
@@ -1051,32 +1051,50 @@ pub struct LinuxSeccomp { | |||
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, StrumDisplay, EnumString)] | |||
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")] | |||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")] | |||
#[repr(u32)] |
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.
I'm not confident whether this line is safe to delete.
Hi, thanks for your update. Since I'm on vacation this week, I'll revisit here after next week. @saschagrunert If possible, can you take a look at this🙏 |
The CI ( |
@musaprg Can you rebase this PR from the main branch to pass the CI? |
This PR adds Features based on the specs-go implementation in the runtime spec. That's supposed to be used by features subcommand of runtime and will replace the local type defined in the runtime such as youki. Signed-off-by: Kotaro Inoue <[email protected]>
Signed-off-by: Kotaro Inoue <[email protected]>
Signed-off-by: Kotaro Inoue <[email protected]>
Signed-off-by: Kotaro Inoue <[email protected]>
Signed-off-by: Kotaro Inoue <[email protected]>
Signed-off-by: Kotaro Inoue <[email protected]>
e247914
to
bda7b0c
Compare
@utam0k Hi, I've rebased the branch with the current main branch. Could you check it again? Thanks. |
related to: youki-dev/youki#2837
This PR adds
Features
based on thespecs-go
implementation in the runtime spec. That's supposed to be used byfeatures
subcommand of runtime and will replace the local type defined in the runtime such as youki.TODO