Skip to content
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

fix: add stdin password for discover, repo ls and repo tags #725

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/oras/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Example - Discover referrers with type 'test-artifact' of manifest 'hello:latest
oras discover --artifact-type test-artifact localhost:5000/hello
`,
Args: cobra.ExactArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
return opts.ReadPassword()
},
RunE: func(cmd *cobra.Command, args []string) error {
opts.targetRef = args[0]
return runDiscover(opts)
Expand Down
3 changes: 3 additions & 0 deletions cmd/oras/repository/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Example - List the repositories under the registry that include values lexically
`,
Args: cobra.ExactArgs(1),
Aliases: []string{"list"},
PreRunE: func(cmd *cobra.Command, args []string) error {
return opts.ReadPassword()
},
RunE: func(cmd *cobra.Command, args []string) error {
opts.hostname = args[0]
return listRepository(opts)
Expand Down
3 changes: 3 additions & 0 deletions cmd/oras/repository/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Example - Show tags of the target repository that include values lexically after
`,
Args: cobra.ExactArgs(1),
Aliases: []string{"show-tags"},
PreRunE: func(cmd *cobra.Command, args []string) error {
return opts.ReadPassword()
},
RunE: func(cmd *cobra.Command, args []string) error {
opts.targetRef = args[0]
return showTags(opts)
Expand Down