From 76da1ec8ec6b0dc39da10652994d3129dd591b75 Mon Sep 17 00:00:00 2001 From: Dmitriy Kalinin Date: Wed, 13 May 2020 12:24:09 -0400 Subject: [PATCH] switch to using WithAuthFromKeychain --- pkg/kbld/image/registry.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pkg/kbld/image/registry.go b/pkg/kbld/image/registry.go index a6d7e43b..4cc340aa 100644 --- a/pkg/kbld/image/registry.go +++ b/pkg/kbld/image/registry.go @@ -57,15 +57,10 @@ func (i Registry) WriteImage(ref regname.Reference, img regv1.Image) error { return err } - authz, err := regauthn.DefaultKeychain.Resolve(ref.Context().Registry) - if err != nil { - return fmt.Errorf("Getting authz details: %s", err) - } - err = i.retry(func() error { return regremote.Write(ref, img, regremote.WithTransport(httpTran), - regremote.WithAuth(authz), + regremote.WithAuthFromKeychain(regauthn.DefaultKeychain), ) }) if err != nil { @@ -90,15 +85,10 @@ func (i Registry) WriteIndex(ref regname.Reference, idx regv1.ImageIndex) error return err } - authz, err := regauthn.DefaultKeychain.Resolve(ref.Context().Registry) - if err != nil { - return fmt.Errorf("Getting authz details: %s", err) - } - err = i.retry(func() error { return regremote.WriteIndex(ref, idx, regremote.WithTransport(httpTran), - regremote.WithAuth(authz), + regremote.WithAuthFromKeychain(regauthn.DefaultKeychain), ) }) if err != nil {