Skip to content

feat: add fetch command to get manifest of an artifact - #449

Merged
shizhMSFT merged 65 commits into
oras-project:mainfrom
qweeah:get-manifest
Aug 15, 2022
Merged

shizhMSFT merged 65 commits into
oras-project:mainfrom
qweeah:get-manifest

Conversation

@qweeah

@qweeah qweeah commented Jul 18, 2022 •

Copy link
Copy Markdown
Contributor

This PR adds an new command manifest and a subcommand fetch for displaying the manifest of an artifact reference with below changes:

  • Moves manifest related code into a new folder. Cobra related code should be put in the cmd.go and functional code should be put in the <sub-command-name>.go. This practice can be applied when we have more sub-commands in blob and repository in the future.

  • Adds a new mocking package to mock repository level operations (e.g. fetch, fetch reference, resolve), add used it for unit testing.

Resolves #301, #463

@qweeah qweeah changed the title Get manifest for an artifact Fetch manifest for an artifact Jul 18, 2022
@qweeah
qweeah marked this pull request as draft July 18, 2022 14:14
@qweeah

qweeah commented Jul 18, 2022 •

Copy link
Copy Markdown
Contributor Author

Convert to draft since we still need to support --platform and that need some work. It's done.

qweeah added 2 commits July 19, 2022 19:59
@qweeah qweeah changed the title Fetch manifest for an artifact [WIP] Fetch manifest for an artifact Jul 19, 2022
Comment thread cmd/oras/fetch-manifest.go Resolved
@qweeah
qweeah marked this pull request as ready for review July 20, 2022 03:04
@qweeah qweeah changed the title [WIP] Fetch manifest for an artifact Fetch manifest for an artifact Jul 20, 2022
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Comment thread cmd/oras/internal/option/platform.go Resolved
Comment thread cmd/oras/internal/option/platform.go Resolved
Signed-off-by: Billy Zha <[email protected]>
@qweeah qweeah changed the title feat: add fetch command to get manifest conent of an artifact feat: add fetch command to get manifest of an artifact Aug 12, 2022
@qweeah
qweeah marked this pull request as ready for review August 15, 2022 07:15
@shizhMSFT shizhMSFT added this to the v0.14.0 milestone Aug 15, 2022
Signed-off-by: Billy Zha <[email protected]>
Comment thread cmd/oras/manifest/cmd.go
"oras.land/oras/cmd/oras/internal/option"
)

func Cmd() *cobra.Command {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we call it Command()?

Comment thread cmd/oras/manifest/cmd.go Outdated
Use: "fetch [flags] <name:tag|name@digest>",
Short: "[Preview] Fetch manifest of the target artifact",
Long: `[Preview] Fetch manifest of the target artifact
** This command is in preview and under development. **

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An example for --descriptor would be better.

qweeah added 10 commits August 15, 2022 20:26
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@shizhMSFT
shizhMSFT merged commit 10f567b into oras-project:main Aug 15, 2022
@qweeah
qweeah deleted the get-manifest branch August 15, 2022 14:06
TerryHowe pushed a commit to TerryHowe/oras that referenced this pull request Feb 2, 2023
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.

ORAS get-manifest command

6 participants