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

Pass CA file location as an arg to the worker #255

Merged
merged 5 commits into from
Aug 11, 2023

Conversation

isobelormiston
Copy link
Contributor

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.

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)
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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
Copy link
Member

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.

@isobelormiston isobelormiston merged commit a872923 into master Aug 11, 2023
7 checks passed
@isobelormiston isobelormiston deleted the ca-cert-loaded-as-volume branch August 11, 2023 08:48
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.

2 participants