-
Notifications
You must be signed in to change notification settings - Fork 1.3k
blobserve: dynamically reload Docker auth config #15442
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
Conversation
started the job as gitpod-build-jenting-blobserve-watch-and-reload-15426.1 because the annotations in the pull request description changed |
@jenting Would it be enough if we test for regressions? And rely for testing for external registries with you? |
I did not see any integration tests regards to blobserve. How do we test regression?
Sure |
5297968
to
8e266e1
Compare
/werft run 👍 started the job as gitpod-build-jenting-blobserve-watch-and-reload-15426.4 |
Signed-off-by: JenTing Hsiao <hsiaoairplane@gmail.com>
8e266e1
to
429de9e
Compare
@aledbf for 👀 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
/werft run 👍 started the job as gitpod-build-jenting-blobserve-watch-and-reload-15426.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not try to change credentials, but verified for regressions that first read still works.
/hold
please unhold when are ready to merge
} | ||
|
||
reg := prometheus.NewRegistry() | ||
|
||
resolverProvider := func() remotes.Resolver { | ||
var resolverOpts docker.ResolverOptions | ||
|
||
dockerCfgMu.RLock() | ||
defer dockerCfgMu.RUnlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit) wonder whether mutex really needed or capturing local reference can be enough
} | ||
fr, err := os.OpenFile(fn, os.O_RDONLY, 0) | ||
if err != nil { | ||
log.WithError(err).Fatal("cannot read docker auth config") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we really fail blobserve or keep using previous credentials?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on how earlier we want to catch the problem.
Fails blob server catches the problem immediately. Using the previous credentials catches the problem when the user report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jenting it is just a question, feel free to merge
/unhold |
Description
AWS ECR requires regular secret rotation.
This PR adds hot-reloading authentication credentials to pull images from the Gitpod container registry.
Similar code change https://github.com/gitpod-io/gitpod/pull/14679/files#diff-9efd0bd7f5ebc628c240ccf20295bf47583097f0d6f426826a0dc5d18b96a096 for reference.
Related Issue(s)
Fixes #15426
How to test
gcp-sa-registry-auth
with another docker credential"message":"reloading file after change","path":"/mnt/pull-secret/pull-secret.json"
Release Notes
Documentation
None
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh