From 153275db82d5e59ef5ef0016a4a24bc3f0ade9de Mon Sep 17 00:00:00 2001 From: Billy Zha Date: Thu, 6 Apr 2023 01:59:48 +0000 Subject: [PATCH] nit: update param order Signed-off-by: Billy Zha --- cmd/oras/root/attach.go | 2 +- cmd/oras/root/blob/delete.go | 2 +- cmd/oras/root/blob/fetch.go | 2 +- cmd/oras/root/blob/push.go | 2 +- cmd/oras/root/cp.go | 2 +- cmd/oras/root/discover.go | 2 +- cmd/oras/root/login.go | 2 +- cmd/oras/root/logout.go | 2 +- cmd/oras/root/manifest/delete.go | 2 +- cmd/oras/root/manifest/fetch.go | 2 +- cmd/oras/root/manifest/fetch_config.go | 2 +- cmd/oras/root/manifest/push.go | 2 +- cmd/oras/root/pull.go | 2 +- cmd/oras/root/push.go | 4 ++-- cmd/oras/root/repo/ls.go | 2 +- cmd/oras/root/repo/tags.go | 2 +- cmd/oras/root/tag.go | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmd/oras/root/attach.go b/cmd/oras/root/attach.go index 0e50b4498..7069a2f42 100644 --- a/cmd/oras/root/attach.go +++ b/cmd/oras/root/attach.go @@ -97,7 +97,7 @@ Example - Attach file to the manifest tagged 'v1' in an OCI layout folder 'layou return cmd } -func runAttach(opts attachOptions, cmd *cobra.Command) error { +func runAttach(cmd *cobra.Command, opts attachOptions) error { ctx, _ := opts.WithContext(cmd.Context()) annotations, err := opts.LoadManifestAnnotations() if err != nil { diff --git a/cmd/oras/root/blob/delete.go b/cmd/oras/root/blob/delete.go index 7254b95e1..5735d9118 100644 --- a/cmd/oras/root/blob/delete.go +++ b/cmd/oras/root/blob/delete.go @@ -69,7 +69,7 @@ Example - Delete a blob and print its descriptor: return cmd } -func deleteBlob(opts deleteBlobOptions, cmd *cobra.Command) (err error) { +func deleteBlob(cmd *cobra.Command, opts deleteBlobOptions) (err error) { ctx, _ := opts.WithContext(cmd.Context()) repo, err := opts.NewRepository(opts.targetRef, opts.Common) if err != nil { diff --git a/cmd/oras/root/blob/fetch.go b/cmd/oras/root/blob/fetch.go index 9d8822f99..7e0ea39e4 100644 --- a/cmd/oras/root/blob/fetch.go +++ b/cmd/oras/root/blob/fetch.go @@ -88,7 +88,7 @@ Example - Fetch and print a blob from OCI image layout archive file 'layout.tar' return cmd } -func fetchBlob(opts fetchBlobOptions, cmd *cobra.Command) (fetchErr error) { +func fetchBlob(cmd *cobra.Command, opts fetchBlobOptions) (fetchErr error) { ctx, _ := opts.WithContext(cmd.Context()) var target oras.ReadOnlyTarget target, err := opts.NewReadonlyTarget(ctx, opts.Common) diff --git a/cmd/oras/root/blob/push.go b/cmd/oras/root/blob/push.go index eb8eb6818..7381bad01 100644 --- a/cmd/oras/root/blob/push.go +++ b/cmd/oras/root/blob/push.go @@ -94,7 +94,7 @@ Example - Push blob 'hi.txt' into an OCI layout folder 'layout-dir': return cmd } -func pushBlob(opts pushBlobOptions, cmd *cobra.Command) (err error) { +func pushBlob(cmd *cobra.Command, opts pushBlobOptions) (err error) { ctx, _ := opts.WithContext(cmd.Context()) repo, err := opts.NewTarget(opts.Common) diff --git a/cmd/oras/root/cp.go b/cmd/oras/root/cp.go index 2b4681c44..8774189cc 100644 --- a/cmd/oras/root/cp.go +++ b/cmd/oras/root/cp.go @@ -95,7 +95,7 @@ Example - Copy an artifact with multiple tags with concurrency tuned: return cmd } -func runCopy(opts copyOptions, cmd *cobra.Command) error { +func runCopy(cmd *cobra.Command, opts copyOptions) error { ctx, _ := opts.WithContext(cmd.Context()) // Prepare source diff --git a/cmd/oras/root/discover.go b/cmd/oras/root/discover.go index aae60131c..cdf677a63 100644 --- a/cmd/oras/root/discover.go +++ b/cmd/oras/root/discover.go @@ -90,7 +90,7 @@ Example - Discover referrers of the manifest tagged 'v1' in an OCI layout folder return cmd } -func runDiscover(opts discoverOptions, cmd *cobra.Command) error { +func runDiscover(cmd *cobra.Command, opts discoverOptions) error { ctx, _ := opts.WithContext(cmd.Context()) repo, err := opts.NewReadonlyTarget(ctx, opts.Common) if err != nil { diff --git a/cmd/oras/root/login.go b/cmd/oras/root/login.go index 826938ad7..5f9da497b 100644 --- a/cmd/oras/root/login.go +++ b/cmd/oras/root/login.go @@ -72,7 +72,7 @@ Example - Log in with username and password in an interactive terminal and no TL return cmd } -func runLogin(opts loginOptions, cmd *cobra.Command) (err error) { +func runLogin(cmd *cobra.Command, opts loginOptions) (err error) { ctx, _ := opts.WithContext(cmd.Context()) // prompt for credential diff --git a/cmd/oras/root/logout.go b/cmd/oras/root/logout.go index 4adde19a3..e1a83c944 100644 --- a/cmd/oras/root/logout.go +++ b/cmd/oras/root/logout.go @@ -50,7 +50,7 @@ Example - Logout: return cmd } -func runLogout(opts logoutOptions, cmd *cobra.Command) error { +func runLogout(cmd *cobra.Command, opts logoutOptions) error { if opts.debug { logrus.SetLevel(logrus.DebugLevel) } diff --git a/cmd/oras/root/manifest/delete.go b/cmd/oras/root/manifest/delete.go index 83533c9cc..82860372a 100644 --- a/cmd/oras/root/manifest/delete.go +++ b/cmd/oras/root/manifest/delete.go @@ -74,7 +74,7 @@ Example - Delete a manifest by digest 'sha256:99e4703fbf30916f549cd6bfa9cdbab614 return cmd } -func deleteManifest(opts deleteOptions, cmd *cobra.Command) error { +func deleteManifest(cmd *cobra.Command, opts deleteOptions) error { ctx, _ := opts.WithContext(cmd.Context()) repo, err := opts.NewRepository(opts.targetRef, opts.Common) if err != nil { diff --git a/cmd/oras/root/manifest/fetch.go b/cmd/oras/root/manifest/fetch.go index ae74bc899..36ac3c0fa 100644 --- a/cmd/oras/root/manifest/fetch.go +++ b/cmd/oras/root/manifest/fetch.go @@ -88,7 +88,7 @@ Example - Fetch raw manifest from an OCI layout archive file 'layout.tar': return cmd } -func fetchManifest(opts fetchOptions, cmd *cobra.Command) (fetchErr error) { +func fetchManifest(cmd *cobra.Command, opts fetchOptions) (fetchErr error) { ctx, _ := opts.WithContext(cmd.Context()) target, err := opts.NewReadonlyTarget(ctx, opts.Common) diff --git a/cmd/oras/root/manifest/fetch_config.go b/cmd/oras/root/manifest/fetch_config.go index 24168ed9a..0d54bbe4a 100644 --- a/cmd/oras/root/manifest/fetch_config.go +++ b/cmd/oras/root/manifest/fetch_config.go @@ -85,7 +85,7 @@ Example - Fetch and print the prettified descriptor of the config: return cmd } -func fetchConfig(opts fetchConfigOptions, cmd *cobra.Command) (fetchErr error) { +func fetchConfig(cmd *cobra.Command, opts fetchConfigOptions) (fetchErr error) { ctx, _ := opts.WithContext(cmd.Context()) repo, err := opts.NewReadonlyTarget(ctx, opts.Common) diff --git a/cmd/oras/root/manifest/push.go b/cmd/oras/root/manifest/push.go index e42e3a5bb..5cd77d03f 100644 --- a/cmd/oras/root/manifest/push.go +++ b/cmd/oras/root/manifest/push.go @@ -103,7 +103,7 @@ Example - Push a manifest to an OCI layout folder 'layout-dir' and tag with 'v1' return cmd } -func pushManifest(opts pushOptions, cmd *cobra.Command) error { +func pushManifest(cmd *cobra.Command, opts pushOptions) error { ctx, _ := opts.WithContext(cmd.Context()) var target oras.Target var err error diff --git a/cmd/oras/root/pull.go b/cmd/oras/root/pull.go index e9dd1a8e6..f4dad0f61 100644 --- a/cmd/oras/root/pull.go +++ b/cmd/oras/root/pull.go @@ -101,7 +101,7 @@ Example - Pull artifact files from an OCI layout archive 'layout.tar': return cmd } -func runPull(opts pullOptions, cmd *cobra.Command) error { +func runPull(cmd *cobra.Command, opts pullOptions) error { ctx, _ := opts.WithContext(cmd.Context()) // Copy Options var printed sync.Map diff --git a/cmd/oras/root/push.go b/cmd/oras/root/push.go index 24563be7e..d97c2d15f 100644 --- a/cmd/oras/root/push.go +++ b/cmd/oras/root/push.go @@ -122,7 +122,7 @@ Example - Push file "hi.txt" into an OCI layout folder 'layout-dir' with tag 'te return cmd } -func runPush(opts pushOptions, cmd *cobra.Command) error { +func runPush(cmd *cobra.Command, opts pushOptions) error { ctx, _ := opts.WithContext(cmd.Context()) annotations, err := opts.LoadManifestAnnotations() if err != nil { @@ -213,7 +213,7 @@ func runPush(opts pushOptions, cmd *cobra.Command) error { return opts.ExportManifest(ctx, store, root) } -func updateDisplayOption(opts *oras.CopyGraphOptions, store content.Fetcher, verbose bool) { +func updateDisplayOption(cmd *cobra.Command, *oras.CopyGraphOptions, store content.Fetcher, verbose bool) { committed := &sync.Map{} opts.PreCopy = display.StatusPrinter("Uploading", verbose) opts.OnCopySkipped = func(ctx context.Context, desc ocispec.Descriptor) error { diff --git a/cmd/oras/root/repo/ls.go b/cmd/oras/root/repo/ls.go index 82002ee93..c2a02dee7 100644 --- a/cmd/oras/root/repo/ls.go +++ b/cmd/oras/root/repo/ls.go @@ -67,7 +67,7 @@ Example - List the repositories under the registry that include values lexically return cmd } -func listRepository(opts repositoryOptions, cmd *cobra.Command) error { +func listRepository(cmd *cobra.Command, opts repositoryOptions) error { ctx, _ := opts.WithContext(cmd.Context()) reg, err := opts.Remote.NewRegistry(opts.hostname, opts.Common) if err != nil { diff --git a/cmd/oras/root/repo/tags.go b/cmd/oras/root/repo/tags.go index 640ae6cc1..81c9562ff 100644 --- a/cmd/oras/root/repo/tags.go +++ b/cmd/oras/root/repo/tags.go @@ -76,7 +76,7 @@ Example - Show tags associated with a digest: return cmd } -func showTags(opts showTagsOptions, cmd *cobra.Command) error { +func showTags(cmd *cobra.Command, opts showTagsOptions) error { ctx, logger := opts.WithContext(cmd.Context()) finder, err := opts.NewReadonlyTarget(ctx, opts.Common) if err != nil { diff --git a/cmd/oras/root/tag.go b/cmd/oras/root/tag.go index 4057c40de..6fccc5b9e 100644 --- a/cmd/oras/root/tag.go +++ b/cmd/oras/root/tag.go @@ -70,7 +70,7 @@ Example - Tag the manifest 'v1.0.1' to 'v1.0.2' in an OCI layout folder 'layout- return cmd } -func tagManifest(opts tagOptions, cmd *cobra.Command) error { +func tagManifest(cmd *cobra.Command, opts tagOptions) error { ctx, _ := opts.WithContext(cmd.Context()) target, err := opts.NewTarget(opts.Common) if err != nil {