-
Notifications
You must be signed in to change notification settings - Fork 528
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 --tarball to crane digest #896
Conversation
283dab0
to
c838fd6
Compare
Codecov Report
@@ Coverage Diff @@
## master #896 +/- ##
==========================================
- Coverage 72.53% 72.46% -0.08%
==========================================
Files 108 108
Lines 4672 4677 +5
==========================================
Hits 3389 3389
- Misses 773 778 +5
Partials 510 510
Continue to review full report at Codecov.
|
Can you make the required tag argument optional? Our tarballs have I've made this change and tested it - it works as expected (crane push and crane digest produce the same digest): img, err := crane.Load(tarball) |
@jonjohnsonjr Do you want me to finish this? I can create a sub-command as you suggested. |
Ah I just forgot about it completely. I have some plans to add another At the same time, it's a bit weird to duplicate all the top-level commands a bunch of times instead of just having flags. The main thing pushing me towards subcommands here is that the cobra stuff for parsing flags and args will be different depending on if you're interacting with a tarball, layout, or registry. The other option would be overloading the reference string with schemes, e.g. It makes a lot of sense to support @imjasonh what do you think about this? # Roughly, `$ tar -Oxf ubuntu.tar manifest.json | jq .[].RepoTags | jq .[] -r`
$ crane ls tarball://ubuntu.tar
ubuntu
# Works for len(tarball) == 1
$ crane [digest|config|manifest] tarball://ubuntu.tar
# For len(tarball) > 1
# Not sure about the separator? How do we handle tarballs with `:` in the filename?
$ crane [digest|config|manifest] tarball://ubuntu.tar:latest Maybe we need a Similarly, for For tl;dr three options:
Not sure which we want to go with. If we go the scheme route, we might want to adopt |
Ping :) img, err := crane.Load(tarball) |
c838fd6
to
d2c9843
Compare
Ended up just finessing this with some manual flag logic. If we want to do something fancier in the future, we can revisit this. I should probably provide a big warning about how this doesn't do what most people would expect, but we can do that if it becomes an issue. |
If specified, tag can be omitted for single-image tarballs.
d2c9843
to
cb59bb1
Compare
Codecov Report
@@ Coverage Diff @@
## main #896 +/- ##
==========================================
+ Coverage 74.52% 74.61% +0.09%
==========================================
Files 107 107
Lines 5020 5027 +7
==========================================
+ Hits 3741 3751 +10
+ Misses 723 721 -2
+ Partials 556 555 -1
Continue to review full report at Codecov.
|
Thanks all |
Fixes #895