Skip to content

Conversation

@mattmoor
Copy link
Collaborator

This adds a krane tool, which is effectively crane with a multi-keychain that prefers default authentication mechanisms, but links k8schain as a fallback.

This enables this tool to act as a drop-in replacement for crane, but it can support common Kubernetes-based workload identity mechanisms.

This adds a `krane` tool, which is effectively `crane` with a multi-keychain that prefers default authentication mechanisms, but links `k8schain` as a fallback.

This enables this tool to act as a drop-in replacement for `crane`, but it can support common Kubernetes-based workload identity mechanisms.
@codecov-commenter
Copy link

codecov-commenter commented Dec 24, 2021

Codecov Report

Merging #1218 (639e5d4) into main (2874338) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1218   +/-   ##
=======================================
  Coverage   73.76%   73.76%           
=======================================
  Files         111      111           
  Lines        8181     8181           
=======================================
  Hits         6035     6035           
  Misses       1549     1549           
  Partials      597      597           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2874338...639e5d4. Read the comment docs.

@mattmoor mattmoor merged commit 3889fab into google:main Dec 29, 2021
@mattmoor mattmoor deleted the krane branch December 29, 2021 18:34
@jonjohnsonjr
Copy link
Collaborator

Step #0: + ./ko publish --platform=all -B github.com/google/go-containerregistry/cmd/krane -t latest -t 3889fab028df2dc8c5402ee23612c3e99e9621dc -t 
Step #0: 2021/12/29 18:38:15 Using base gcr.io/distroless/static:nonroot for github.com/google/go-containerregistry/cmd/krane
Step #0: 2021/12/29 18:38:15 Building github.com/google/go-containerregistry/cmd/krane for linux/amd64
Step #0: 2021/12/29 18:38:16 Unexpected error running "go build": exit status 1
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go:24:2: cannot find package "github.com/vdemeester/k8s-pkg-credentialprovider" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/github.com/vdemeester/k8s-pkg-credentialprovider (vendor tree)
Step #0: 	/usr/local/go/src/github.com/vdemeester/k8s-pkg-credentialprovider (from $GOROOT)
Step #0: 	/go/src/github.com/vdemeester/k8s-pkg-credentialprovider (from $GOPATH)
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain_aws.go:22:2: cannot find package "github.com/vdemeester/k8s-pkg-credentialprovider/aws" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/github.com/vdemeester/k8s-pkg-credentialprovider/aws (vendor tree)
Step #0: 	/usr/local/go/src/github.com/vdemeester/k8s-pkg-credentialprovider/aws (from $GOROOT)
Step #0: 	/go/src/github.com/vdemeester/k8s-pkg-credentialprovider/aws (from $GOPATH)
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain_azure.go:22:2: cannot find package "github.com/vdemeester/k8s-pkg-credentialprovider/azure" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/github.com/vdemeester/k8s-pkg-credentialprovider/azure (vendor tree)
Step #0: 	/usr/local/go/src/github.com/vdemeester/k8s-pkg-credentialprovider/azure (from $GOROOT)
Step #0: 	/go/src/github.com/vdemeester/k8s-pkg-credentialprovider/azure (from $GOPATH)
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain_gcp.go:22:2: cannot find package "github.com/vdemeester/k8s-pkg-credentialprovider/gcp" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/github.com/vdemeester/k8s-pkg-credentialprovider/gcp (vendor tree)
Step #0: 	/usr/local/go/src/github.com/vdemeester/k8s-pkg-credentialprovider/gcp (from $GOROOT)
Step #0: 	/go/src/github.com/vdemeester/k8s-pkg-credentialprovider/gcp (from $GOPATH)
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go:25:2: cannot find package "github.com/vdemeester/k8s-pkg-credentialprovider/secrets" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/github.com/vdemeester/k8s-pkg-credentialprovider/secrets (vendor tree)
Step #0: 	/usr/local/go/src/github.com/vdemeester/k8s-pkg-credentialprovider/secrets (from $GOROOT)
Step #0: 	/go/src/github.com/vdemeester/k8s-pkg-credentialprovider/secrets (from $GOPATH)
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go:26:2: cannot find package "k8s.io/api/core/v1" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/k8s.io/api/core/v1 (vendor tree)
Step #0: 	/usr/local/go/src/k8s.io/api/core/v1 (from $GOROOT)
Step #0: 	/go/src/k8s.io/api/core/v1 (from $GOPATH)
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go:27:2: cannot find package "k8s.io/apimachinery/pkg/apis/meta/v1" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/k8s.io/apimachinery/pkg/apis/meta/v1 (vendor tree)
Step #0: 	/usr/local/go/src/k8s.io/apimachinery/pkg/apis/meta/v1 (from $GOROOT)
Step #0: 	/go/src/k8s.io/apimachinery/pkg/apis/meta/v1 (from $GOPATH)
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go:28:2: cannot find package "k8s.io/client-go/kubernetes" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/k8s.io/client-go/kubernetes (vendor tree)
Step #0: 	/usr/local/go/src/k8s.io/client-go/kubernetes (from $GOROOT)
Step #0: 	/go/src/k8s.io/client-go/kubernetes (from $GOPATH)
Step #0: /go/src/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go:29:2: cannot find package "k8s.io/client-go/rest" in any of:
Step #0: 	/go/src/github.com/google/go-containerregistry/vendor/k8s.io/client-go/rest (vendor tree)
Step #0: 	/usr/local/go/src/k8s.io/client-go/rest (from $GOROOT)
Step #0: 	/go/src/k8s.io/client-go/rest (from $GOPATH)
Step #0: 2021/12/29 18:38:16 failed to publish images: error building "ko://github.com/google/go-containerregistry/cmd/krane": exit status 1

@mattmoor
Copy link
Collaborator Author

I believe the problem is that we do a ko publish of the ./cmd/krane sub-module while our current directory is the GGCR module still, which I think confuses things. Locally this works just fine if I'm in ./cmd/krane, and I'm testing a change to cloudbuild.yaml against my own project now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants