Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pkg/authn/github.Keychain to authenticate with ghcr.io #1252

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

imjasonh
Copy link
Collaborator

Fixes #1251

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2022

Codecov Report

Merging #1252 (25e097a) into main (c63684e) will decrease coverage by 0.10%.
The diff coverage is 100.00%.

❗ Current head 25e097a differs from pull request most recent head 7fbd4f4. Consider uploading reports for the commit 7fbd4f4 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1252      +/-   ##
==========================================
- Coverage   73.92%   73.82%   -0.11%     
==========================================
  Files         111      112       +1     
  Lines        8345     8301      -44     
==========================================
- Hits         6169     6128      -41     
+ Misses       1573     1571       -2     
+ Partials      603      602       -1     
Impacted Files Coverage Δ
pkg/authn/github/keychain.go 100.00% <100.00%> (ø)
pkg/authn/keychain.go 85.48% <0.00%> (-0.67%) ⬇️
pkg/v1/daemon/image.go 75.51% <0.00%> (-0.17%) ⬇️
pkg/v1/platform.go 100.00% <0.00%> (ø)

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 c63684e...7fbd4f4. Read the comment docs.

@@ -51,6 +52,7 @@ func main() {
keychain := authn.NewMultiKeychain(
authn.DefaultKeychain,
google.Keychain,
github.Keychain,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was gonna be my feedback. Now I’m regretting not calling this omicrane after all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only been released once as krane, you can change it.

Ooooooor, release it as github.com/mattmoor/omnicrane instead... 😈

@imjasonh
Copy link
Collaborator Author

imjasonh commented Feb 2, 2022

@jonjohnsonjr ping

- if GITHUB_TOKEN env var is set, and registry is ghcr.io, use the
  token as a password.
- if GITHUB_ACTOR env var is set, use it for the auth username.
@imjasonh imjasonh merged commit 9c35968 into google:main Feb 2, 2022
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.

pkg/authn/github.Keychain
4 participants