-
Notifications
You must be signed in to change notification settings - Fork 50
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
impl Default
for Os
and Arch
, use in ImageConfiguration::default()
#90
Conversation
…lt()` Hardcoding Linux/x86_64 is a trap because it will silently do the right thing only for users on that platform. Closes: youki-dev#88
@@ -227,6 +227,12 @@ impl<'de> Deserialize<'de> for Os { | |||
} | |||
} | |||
|
|||
impl Default for Os { | |||
fn default() -> Self { | |||
Os::from(std::env::consts::OS) |
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 spot checked this and it seems like there's enough overlap with what Rust has in https://doc.rust-lang.org/std/env/consts/constant.OS.html and what OCI (really Go I guess) expects.
OK I just got a link to https://github.com/containerd/containerd/blob/140ecc9247386d3be21616fe285021c081f4ea08/platforms/database.go#L83
which seems to be a key player in this.
Since we can, and this silences a clippy warning.
Codecov Report
@@ Coverage Diff @@
## main #90 +/- ##
==========================================
+ Coverage 25.26% 25.59% +0.32%
==========================================
Files 20 20
Lines 1488 1481 -7
Branches 714 706 -8
==========================================
+ Hits 376 379 +3
+ Misses 469 463 -6
+ Partials 643 639 -4 |
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.
LGTM
Actually it turns out there was a bug related to |
Hardcoding Linux/x86_64 is a trap because it will silently do the
right thing only for users on that platform.
Closes: #88