mirror of
https://github.com/ko-build/ko.git
synced 2025-11-26 22:40:38 +02:00
@@ -17,6 +17,7 @@ package publish
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"path"
|
||||
|
||||
"github.com/google/go-containerregistry/pkg/authn"
|
||||
"github.com/google/go-containerregistry/pkg/name"
|
||||
@@ -48,15 +49,13 @@ func WithAuthFromKeychain(keys authn.Keychain) Option {
|
||||
// means that docker.io/mattmoor actually gets interpreted as
|
||||
// docker.io/library/mattmoor, which gets tricky when we start
|
||||
// appending things to it in the publisher.
|
||||
repo, err := name.NewRepository(i.base)
|
||||
if err != nil {
|
||||
// Workaround for localhost:5000 as KO_DOCKER_REPO.
|
||||
reg, err := name.NewRegistry(i.base)
|
||||
//
|
||||
// We append a fake path "ko" to KO_DOCKER_REPO in order to
|
||||
// make parsing out the registry easier.
|
||||
repo, err := name.NewRepository(path.Join(i.base, "ko"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
repo = name.Repository{Registry: reg}
|
||||
}
|
||||
auth, err := keys.Resolve(repo.Registry)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user