From 8c10137154b23747a6e755331a697d1d40316cc5 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Mon, 2 Dec 2024 09:59:33 +0100 Subject: [PATCH] name fix Signed-off-by: David Fridrich --- cmd/prompt/prompt.go | 8 ++++---- pkg/docker/creds/credentials.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/prompt/prompt.go b/cmd/prompt/prompt.go index f5b282f30..120e76afc 100644 --- a/cmd/prompt/prompt.go +++ b/cmd/prompt/prompt.go @@ -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{ diff --git a/pkg/docker/creds/credentials.go b/pkg/docker/creds/credentials.go index 0a3ba94db..47e15a28e 100644 --- a/pkg/docker/creds/credentials.go +++ b/pkg/docker/creds/credentials.go @@ -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 }