Skip to content

Commit

Permalink
name fix
Browse files Browse the repository at this point in the history
Signed-off-by: David Fridrich <[email protected]>
  • Loading branch information
gauron99 committed Dec 2, 2024
1 parent 00b368c commit 8c10137
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cmd/prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import (
"knative.dev/func/pkg/docker/creds"
)

func NewPromptForCredentials(in io.Reader, out, errOut io.Writer) func(registryWithRepo string) (docker.Credentials, error) {
func NewPromptForCredentials(in io.Reader, out, errOut io.Writer) func(registry string) (docker.Credentials, error) {
firstTime := true
return func(registryWithRepo string) (docker.Credentials, error) {
return func(registry string) (docker.Credentials, error) {
var result docker.Credentials
if firstTime {
firstTime = false
fmt.Fprintf(out, "Please provide credentials for repository '%s'.\n", registryWithRepo)
fmt.Fprintf(out, "Please provide credentials for repository '%s'.\n", registry)
} else {
fmt.Fprintf(out, "Incorrect credentials for repository '%s'. Please make sure the image is correct and try again.\n", registryWithRepo)
fmt.Fprintf(out, "Incorrect credentials for repository '%s'. Please make sure the image is correct and try again.\n", registry)
}

var qs = []*survey.Question{
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/creds/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ func (c *credentialsProvider) getCredentials(ctx context.Context, image string)

// this is [registry] / [repository]
// this is index.io / user/imagename
registryWithRepository := registry + "/" + ref.Context().RepositoryStr()
repository := registry + "/" + ref.Context().RepositoryStr()

// the trying-to-actually-authorize cycle
for {
// use repo here to print it out in prompt
result, err = c.promptForCredentials(registryWithRepository)
result, err = c.promptForCredentials(repository)
if err != nil {
return docker.Credentials{}, err
}
Expand Down

0 comments on commit 8c10137

Please sign in to comment.