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

add repository to the credentials prompt #2596

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
9 changes: 4 additions & 5 deletions cmd/prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ import (
"knative.dev/func/pkg/docker/creds"
)

func NewPromptForCredentials(in io.Reader, out, errOut io.Writer) func(registry string) (docker.Credentials, error) {
func NewPromptForCredentials(in io.Reader, out, errOut io.Writer) func(registryWithRepo string) (docker.Credentials, error) {
firstTime := true
return func(registry string) (docker.Credentials, error) {
return func(registryWithRepo string) (docker.Credentials, error) {
var result docker.Credentials

if firstTime {
firstTime = false
fmt.Fprintf(out, "Please provide credentials for image registry (%s).\n", registry)
fmt.Fprintf(out, "Please provide credentials for repository '%s'.\n", registryWithRepo)
} else {
fmt.Fprintln(out, "Incorrect credentials, please try again.")
fmt.Fprintf(out, "Incorrect credentials for repository '%s'. Please make sure the image is correct and try again.\n", registryWithRepo)
}

var qs = []*survey.Question{
Expand Down
Loading
Loading