-
Notifications
You must be signed in to change notification settings - Fork 10
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
Pass CA file location as an arg to the worker #255
Conversation
mettle/worker/redis.go
Outdated
func getTLSConfig(caFile string) *tls.Config { | ||
caCert, err := os.ReadFile(caFile) | ||
if err != nil { | ||
log.Warning("Failed to collect CA cert from file %s: '%s'. Redis connection will not work", caFile, err) |
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 think you should probably return an error here, and die if it fails. If someone passes a CA I'd expect it not to carry on if it can't load it.
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.
Do you mean let the whole worker die?
Atm the redis approach is best-effort, hence just a warning (although it should probably be propagated up to where the worker initialises the redis client). Would a warning along with an alert when we see it make sense?
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.
Well writing and connecting to Redis is best-effort, but I wouldn't expect loading the CA cert to fail?
ChangeLog
Outdated
@@ -1,3 +1,7 @@ | |||
Version 11.1.1 |
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.
If we're strictly doing semver this is 11.2.0 because it's a feature :) Not that we're that strict in this repo.
The worker can now accept a Redis CA file location, which it then reads when initialising the Redis instance. This is so that we can configure different please-servers instances to use different Redis instances, with the same worker docker image.