-
Notifications
You must be signed in to change notification settings - Fork 5
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
S3 Backend: load keys from file with automatic reload #46
Conversation
9e8244f
to
961f462
Compare
backends/s3/credentials.go
Outdated
type K8sSecretProvider struct { | ||
// Path to the fiel containing the access key, | ||
// e.g. /etc/s3-secrets/access-key. | ||
AccessKeyFilename string `json:"access_key_file"` |
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.
JSON name does not match the variable name. In this case it would commonly be called access_key_filename
, or the variable named AccessKeyFile
. There is no good reason to deviate from this pattern here.
|
||
stop := func() error { | ||
_ = cmd.Process.Signal(os.Interrupt) | ||
return cmd.Wait() |
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.
This could hang forever if the context does not have a timeout.
The PR description mentions |
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.
LGTM, aside from two minor things.
Co-authored-by: wojas <[email protected]>
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.
LGTM!
LGTM Tested this PR in 2 applications in a Kubernetes deployment and both worked as expected: Cycling the access/secret keys in the Secret leads to Simpleblob picking up the updated credentials once the Secret is synced to the filesystem of the container. |
Introduce a
github.com/minio/minio-go/v7/pkg/credentials.Provider
implementation, accepting credentials split accross different files as with Kubernetes Secrets or Docker Secrets.This way, the backend can get its S3 credentials with a configuration similar to: