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

Rename os_version to os.version #163

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

orf
Copy link

@orf orf commented Apr 13, 2024

I believe this should be os.version like ImageConfig?

For example this is what Github container repo returns:

{
  "schemaVersion": 2,
  "manifests": [
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:b09d1eb75170275f0e465ed97e90718e596aab4a2413ba7eedcfb9f13580aca6",
      "size": 2015,
      "platform": {
        "architecture": "amd64",
        "os": "darwin",
        "os.version": "macOS 13.3"
      },

Also the tests failed on MacOS. I fixed this by canonicalising the temporary directory as well:

thread 'runtime::tests::test_canonicalize_rootfs' panicked at 'assertion failed: `(left == right)`
  left: `"/var/folders/q1/c031nnz57ls4qm4dk3m3w74h0000gn/T/.tmpxAJ0q3/rootfs"`,
 right: `"/private/var/folders/q1/c031nnz57ls4qm4dk3m3w74h0000gn/T/.tmpxAJ0q3/rootfs"`', src/runtime/mod.rs:306:13

Unfortunately std::env::consts::OS returns macos instead of Darwin, so I added an extra arm to the match condition to handle this. This makes Default work properly on MacOS.

Same as #134

Signed-off-by: Tom Forbes <tom@tomforb.es>
@@ -231,6 +231,8 @@ impl From<&str> for Os {
"aix" => Os::AIX,
"android" => Os::Android,
"darwin" => Os::Darwin,
// std::env::consts::OS returns "macos" instead of darwin
"macos" => Os::Darwin,
Copy link
Member

Choose a reason for hiding this comment

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

May I ask you to create another commit or PR about this change?

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