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

Fix no export subcmd panic on mac #1429

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

An-DJ
Copy link
Contributor

@An-DJ An-DJ commented Sep 18, 2023

Relevant Issue (if applicable)

If there are Issues related to this PullRequest, please list it.

Fix panic caused by no export subcmd on mac in issue #1340

Details

Please describe the details of PullRequest.

Types of changes

What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

Signed-off-by: Junduo Dong <dongjunduo.djd@antgroup.com>
@An-DJ An-DJ requested a review from a team as a code owner September 18, 2023 11:51
@An-DJ An-DJ requested review from bergwolf, liubin and changweige and removed request for a team September 18, 2023 11:51
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #1429 (c7aeefd) into master (d2fcfcd) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1429      +/-   ##
==========================================
- Coverage   46.46%   46.44%   -0.02%     
==========================================
  Files         123      123              
  Lines       38643    38643              
  Branches    38643    38643              
==========================================
- Hits        17954    17948       -6     
- Misses      19716    19722       +6     
  Partials      973      973              
Files Changed Coverage Δ
src/bin/nydus-image/main.rs 41.62% <0.00%> (ø)

... and 3 files with indirect coverage changes

Signed-off-by: Junduo Dong <dongjunduo.djd@antgroup.com>
}
#[cfg(not(target_os = "linux"))]
{
println!("{}", usage);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fixup! Maybe give the warning to tell users we can't support export subcommand for macos here?

Copy link
Contributor Author

@An-DJ An-DJ Sep 21, 2023

Choose a reason for hiding this comment

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

Actually if the user runs export on macos, it cannot be recognized.

% ./target/debug/nydus-image export
error: The subcommand 'export' wasn't recognized

Usage: nydus-image [OPTIONS] [COMMAND]

For more information try '--help'

IMHO this error msg is enough, isn't it ? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also export has been removed from the available subcmd on macos:

% ./target/debug/nydus-image -h
Build, analyze, inspect or validate RAFS filesystems/Nydus accelerated container images

Usage: nydus-image [OPTIONS] [COMMAND]

Commands:
  create     Create RAFS filesystems from directories, tar files or OCI images
  chunkdict  deduplicate RAFS filesystem metadata
  merge      Merge multiple bootstraps into a overlaid bootstrap
  check      Validate RAFS filesystem metadata
  inspect    Inspect RAFS filesystem metadata in interactive or request mode
  stat       Generate statistics information for RAFS filesystems
  compact    (experimental)Compact specific nydus image, remove unused chunks in blobs, merge small blobs
  unpack     Unpack a RAFS filesystem to a tar file
  help       Print this message or the help of the given subcommand(s)

Options:
  -L, --log-file <log-file>    Log file path
  -l, --log-level <log-level>  Log level: [default: info] [possible values: trace, debug, info, warn, error]
  -h, --help                   Print help information
  -V, --version                Print version information

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, maybe some macos users ask why not have export subcommand on his mac, but I think it's also okay for me.

@imeoer imeoer merged commit 148cf96 into dragonflyoss:master Sep 25, 2023
23 of 24 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.

None yet

2 participants