-
Notifications
You must be signed in to change notification settings - Fork 171
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 attach command #433
Add attach command #433
Conversation
Bumps [github.com/docker/cli](https://github.com/docker/cli) from 20.10.16+incompatible to 20.10.17+incompatible. - [Release notes](https://github.com/docker/cli/releases) - [Commits](docker/cli@v20.10.16...v20.10.17) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <qweeah@gmail.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <qweeah@gmail.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <qweeah@gmail.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com>
…ras-project#425) 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: Juncheng Zhu <junczhu@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>
internal/content/file.go
Outdated
} | ||
} | ||
|
||
// LoadFiles loads file reference to a file store and and returns the |
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.
nit: file references?
cmd/oras/internal/option/pusher.go
Outdated
|
||
// Pusher option struct. | ||
type Pusher struct { | ||
ManifestExport string |
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.
maybe ManifestExportPath
?
cmd/oras/internal/option/pusher.go
Outdated
|
||
// ApplyFlags applies flags to a command flag set. | ||
func (opts *Pusher) ApplyFlags(fs *pflag.FlagSet) { | ||
fs.StringVarP(&opts.ManifestExport, "export-manifest", "", "", "export the pushed manifest") |
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.
This sounds like a true/false flag. I think we need to call out this is the file path of the exported manifest.
cmd/oras/internal/option/pusher.go
Outdated
} | ||
|
||
// ExportManifest saves the pushed manifest to a local file. | ||
func (opts *Pusher) ExportManifest(ctx context.Context, pushed ocispec.Descriptor, pushedTo content.Fetcher) error { |
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.
Should we have some unit tests for this function?
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.
Will create an issue to add unit test for pusher options
cmd/oras/attach.go
Outdated
} | ||
|
||
// OCIToArtifact converts OCI descriptor to artifact descriptor. | ||
func OCIToArtifact(desc ocispec.Descriptor) *artifactspec.Descriptor { |
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.
Can we just return a struct?
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.
Since & is banned for function return values, code will be cleaner if we returns a pointer
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>
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
Introducing a new simplified experience to add an artifact to an existed manifest:
attach
to add an artifact to a existed manifestRelated to #424