-
Notifications
You must be signed in to change notification settings - Fork 180
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
feat(oci-layout): support in oras push
and oras attach
#750
Conversation
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Codecov Report
@@ Coverage Diff @@
## main #750 +/- ##
==========================================
+ Coverage 63.96% 64.14% +0.18%
==========================================
Files 19 19
Lines 702 700 -2
==========================================
Hits 449 449
+ Misses 222 220 -2
Partials 31 31
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
oras push
and oras attach
oras push
and oras attach
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.
The examples in CLI help look good to me!
// Reassemble a reference with subject digest | ||
if repo, ok := dst.(*remote.Repository); ok { | ||
ref := repo.Reference | ||
ref.Reference = subject.Digest.String() | ||
opts.RawReference = ref.String() | ||
} else if opts.Type == option.TargetTypeOCILayout { | ||
opts.RawReference = fmt.Sprintf("%s@%s", opts.Path, subject.Digest) | ||
} |
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.
We can just do switch opts.Type
.
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.
But repo.Reference
(including Host name and repository name) need *remote.Repository
type assertion anyway.
oerrors "oras.land/oras/cmd/oras/internal/errors" | ||
"oras.land/oras/cmd/oras/internal/option" | ||
) | ||
|
||
type attachOptions struct { | ||
option.Common | ||
option.Remote | ||
option.Packer | ||
option.ImageSpec | ||
option.DistributionSpec |
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 just noticed that the DistributionSpec
should be stick to the option.Remote
. This should also be applied to oras cp
and oras manifest push
.
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.
No it should not. If we do that, DistributionSpec
will be applied to all commands related to option.Remote
, which is wrong considering the following cases:
- Since
oras push
is not related to referrers maintanance, the execution is always the same no matter what value is provided to--distribution-spec
. So we should NEVER apply this flag tooras push
. Same for other commands. - If user specify
--distribution-spec v1.1-referrers-tag
tooras discover
, should the command looking for referrers via tag scheme? We should design the expected behaviour and then add this flag to those commands. Before that,--distribution-spec
should not be applied tooras discover
.
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
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
…ect#750) Related to oras-project#378 Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Related to #378