Registry / auth / google-go-containerregistry-pkg-authn-kubernetes

google-go-containerregistry-pkg-authn-kubernetes

JSON →
library0.0.0-20260520013816-d807d512681cgogounverified

Package kubernetes provides authentication methods for container registries using Kubernetes secrets.

go get github.com/google/go-containerregistry/pkg/authn/kubernetes
INSTALL
IMPORT
SIG · GOOGLE-GO-CONTAINE
G
google-go-containerregistry-pkg-authn-kubernetes
authgov0.0.0-20260520013816-d807d512681c
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

kubernetes
github.com/google/go-containerregistry/pkg/authn/kubernetes

Create a Kubernetes-based authenticator from a secret

package main import ( "context" "fmt" "github.com/google/go-containerregistry/pkg/authn/kubernetes" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" ) func main() { clientset := fake.NewSimpleClientset(&v1.Secret{ ObjectMeta: metav1.ObjectMeta{Name: "my-secret", Namespace: "default"}, Data: map[string][]byte{v1.DockerConfigJsonKey: []byte(`{"auths":{"https://index.docker.io/v1/":{"auth":"dXNlcjpwYXNz"}}}`)}, }) auth, err := kubernetes.NewFromSecret(context.Background(), clientset, "default", "my-secret") if err != nil { panic(err) } fmt.Println(auth) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20260520013816-d807d512681clatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
2
Amazon
1
Resources
google-go-containerregistry-pkg-authn-kubernetes — go get google-go-containerregistry-pkg-authn-kubernetes · libregistry