Add GitLab CI credentials helper (#2040)

This simplifies usage of Kaniko in GitLab CI environments and
means that it's not longer necessary to manually cobble together
the config with the right values from the environment in
error-prone shell commands.
This commit is contained in:
ePirat
2022-04-11 13:13:47 -04:00
committed by GitHub
parent a5d96682ac
commit f930b75b8b
6 changed files with 137 additions and 0 deletions
+2
View File
@@ -21,6 +21,7 @@ import (
ecr "github.com/awslabs/amazon-ecr-credential-helper/ecr-login"
"github.com/chrismellard/docker-credential-acr-env/pkg/credhelper"
gitlab "github.com/ePirat/docker-credential-gitlabci/pkg/credhelper"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/v1/google"
)
@@ -32,5 +33,6 @@ func GetKeychain() authn.Keychain {
google.Keychain,
authn.NewKeychainFromHelper(ecr.NewECRHelper(ecr.WithLogger(ioutil.Discard))),
authn.NewKeychainFromHelper(credhelper.NewACRCredentialsHelper()),
authn.NewKeychainFromHelper(gitlab.NewGitLabCredentialsHelper()),
)
}