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

spec: skip serializing several params if String is empty in Spec #20

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

Vanient
Copy link
Member

@Vanient Vanient commented Nov 25, 2023

If mount_label, rootfs_propagation, apparmor_profile or namespace path not defined in config.json created by containerd/iSulad, kuasar will use default value "" during deserializing Spec.
And when kuasar do serializing and store to new config.json created by itself, those params will show in json with value "". When Youki does deserializing, as it uses Spec in crate oci-spec, these params' data types are Option, so their values will be Some(""), but youki only checks if the value is Some when using, which causes lots of problems like failed to open namespace file ""...

If mount_label, rootfs_propagation, apparmor_profile or namespace path
not defined in config.json created by containerd/iSulad, kuasar will
use default value "" during deserializing Spec.
And when kuasar do serializing and store to new config.json created by
itself, those params will show in json with value "".
When Youki does deserializing, as it uses Spec in crate oci-spec, these
params' data types are Option<String>, so their values will be Some(""),
but youki only checks if the value is Some when using, which
causes lots of problems like `failed to open namespace file ""...`

Signed-off-by: Vanient <[email protected]>
Copy link
Member

@Burning1020 Burning1020 left a comment

Choose a reason for hiding this comment

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

lgtm

@flyflypeng
Copy link
Member

flyflypeng commented Dec 8, 2023

lgtm

@Burning1020 Burning1020 merged commit 55eb50e into kuasar-io:main Dec 8, 2023
1 of 9 checks passed
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