-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix #626 panic on invalid tls config in secret #627
base: main
Are you sure you want to change the base?
Changes from all commits
f25bbc9
f2e62c7
cdfd461
3e4a61a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,16 +127,18 @@ func (r *Reconciler) updateRedisConfig(ctx context.Context, configMap *corev1.Co | |
redisConfig, err := GetRedisConfig(configMap.Data) | ||
if err != nil { | ||
logging.FromContext(ctx).Errorw("Error reading Redis configuration", zap.Error(err)) | ||
} else { | ||
// For now just override the previous config. | ||
r.numConsumers = redisConfig.NumConsumers | ||
Comment on lines
+130
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: to make the code a bit cleaner here, instead of using an |
||
} | ||
// For now just override the previous config. | ||
r.numConsumers = redisConfig.NumConsumers | ||
} | ||
|
||
func (r *Reconciler) updateTLSSecret(ctx context.Context, secret *corev1.Secret) { | ||
tlsSecret, err := GetTLSSecret(secret.Data) | ||
if err != nil { | ||
logging.FromContext(ctx).Errorw("Error reading TLS configuration", zap.Error(err)) | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: to make the code a bit cleaner here, instead of using an |
||
// For now just override the previous config. | ||
r.tlsCert = tlsSecret.TLSCertificate | ||
} | ||
// For now just override the previous config. | ||
r.tlsCert = tlsSecret.TLSCertificate | ||
} |
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: to make the code a bit cleaner here, instead of using an
else
, could youreturn
in theif err != nil
block?