Skip to content

Commit

Permalink
Remove k8schain, statically link helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh authored Jan 21, 2022
1 parent 6bbd8a3 commit 25c9a67
Show file tree
Hide file tree
Showing 1,959 changed files with 584 additions and 608,741 deletions.
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ require (
cloud.google.com/go/storage v1.18.2
github.com/Azure/azure-storage-blob-go v0.14.0
github.com/aws/aws-sdk-go v1.42.38
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20211215200129-69c85dc22db6
github.com/chrismellard/docker-credential-acr-env v0.0.0-20220119192733-fe33c00cee21
github.com/containerd/cgroups v1.0.2 // indirect
github.com/docker/docker v20.10.12+incompatible
github.com/genuinetools/bpfd v0.0.2-0.20190525234658-c12d8cd9aac8
github.com/go-git/go-billy/v5 v5.3.1
github.com/go-git/go-git/v5 v5.4.2
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/golang/mock v1.6.0
github.com/google/go-cmp v0.5.7
github.com/google/go-containerregistry v0.8.1-0.20220110151055-a61fd0a8e2bb
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20220120151853-ac864e57b117
github.com/google/go-containerregistry v0.8.0
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20210208222243-cbafe638a7a9 // indirect
github.com/google/go-github v17.0.0+incompatible
github.com/google/slowjam v1.0.0
github.com/karrick/godirwalk v1.16.1
Expand All @@ -33,7 +37,7 @@ require (
github.com/spf13/afero v1.8.0
github.com/spf13/cobra v1.3.0
github.com/spf13/pflag v1.0.5
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d
golang.org/x/net v0.0.0-20220121175114-2ed6ce1e1725
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
)
Expand Down Expand Up @@ -72,12 +76,9 @@ require (
github.com/aws/aws-sdk-go-v2/service/sso v1.9.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.14.0 // indirect
github.com/aws/smithy-go v1.10.0 // indirect
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20211215200129-69c85dc22db6 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chrismellard/docker-credential-acr-env v0.0.0-20220119192733-fe33c00cee21 // indirect
github.com/cilium/ebpf v0.8.0 // indirect
github.com/containerd/cgroups v1.0.2 // indirect
github.com/containerd/containerd v1.5.9 // indirect
github.com/containerd/continuity v0.2.2 // indirect
github.com/containerd/fifo v1.0.0 // indirect
Expand All @@ -101,7 +102,6 @@ require (
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand Down
720 changes: 466 additions & 254 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hack/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def get_regexs():
# Search for "YEAR" which exists in the boilerplate, but shouldn't in the real thing
regexs["year"] = re.compile( 'YEAR' )
# dates can be 2018, 2019, 2020 company holder names can be anything
regexs["date"] = re.compile( '(2018|2019|2020|2021)' )
regexs["date"] = re.compile( '(2018|2019|2020|2021|2022)' )
# strip // go:build \n\n build constraints
regexs["go_build_constraints_go"] = re.compile(r"^(//go\:build.*)+\n", re.MULTILINE)
# strip // +build \n\n build constraints
Expand Down
34 changes: 10 additions & 24 deletions pkg/creds/creds_darwin.go → pkg/creds/creds.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2018 Google LLC
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,33 +17,19 @@ limitations under the License.
package creds

import (
"log"
"sync"

ecr "github.com/awslabs/amazon-ecr-credential-helper/ecr-login"
"github.com/awslabs/amazon-ecr-credential-helper/ecr-login/api"
"github.com/chrismellard/docker-credential-acr-env/pkg/credhelper"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/v1/google"
)

var (
setupKeychainOnce sync.Once
keychain authn.Keychain
)

// GetKeychain returns a keychain for accessing container registries.
func GetKeychain() authn.Keychain {
setupKeychainOnce.Do(func() {
keychain = authn.DefaultKeychain

// Historically kaniko was pre-configured by default with gcr
// credential helper, in here we keep the backwards
// compatibility by enabling the GCR helper only when gcr.io
// (or pkg.dev) is in one of the destinations.
gauth, err := google.NewEnvAuthenticator()
if err != nil {
log.Printf("Failed to setup Google env authenticator, ignoring: %v", err)
} else {
keychain = authn.NewMultiKeychain(authn.DefaultKeychain, gcrKeychain{gauth})
}
})
return keychain
return authn.NewMultiKeychain(
authn.DefaultKeychain,
google.Keychain,
authn.NewKeychainFromHelper(ecr.ECRHelper{ClientFactory: api.DefaultClientFactory{}}),
authn.NewKeychainFromHelper(credhelper.NewACRCredentialsHelper()),
)
}
62 changes: 0 additions & 62 deletions pkg/creds/creds_linux.go

This file was deleted.

37 changes: 0 additions & 37 deletions pkg/creds/gcr_keychain.go

This file was deleted.

140 changes: 0 additions & 140 deletions vendor/cloud.google.com/go/storage/internal/apiv2/doc.go

This file was deleted.

This file was deleted.

Loading

0 comments on commit 25c9a67

Please sign in to comment.