-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for GitHub into the key chain. (#109)
* We want to be able to run hydros in cluster and authenticate to GHCR * To do that we include github.Keychain which will look for GITHUB_TOKEN environment variable * see google/go-containerregistry#1252
- Loading branch information
Showing
3 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package images | ||
|
||
import ( | ||
"github.com/google/go-containerregistry/pkg/authn" | ||
"github.com/google/go-containerregistry/pkg/authn/github" | ||
"github.com/google/go-containerregistry/pkg/v1/google" | ||
) | ||
|
||
var ( | ||
// TODO(jeremy): Should we add support for Azure and AWS? | ||
// see https://github.com/google/go-containerregistry/pull/1252/files#diff-d062be9a5715169ccabeaa8a2d525b7340f8ec9a7534b3a27dfd1ae35148de29 | ||
// for how we could do that. | ||
// TODO(jeremy): Should we use K8s chain? https://github.com/google/go-containerregistry/blob/main/pkg/authn/k8schain/README.md | ||
keychain = authn.NewMultiKeychain( | ||
authn.DefaultKeychain, | ||
google.Keychain, | ||
github.Keychain, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters