-
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?
Fix #626 panic on invalid tls config in secret #627
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tdeverdiere The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…f they are nil
75fa8da
to
3e4a61a
Compare
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 left a couple nits regarding the code, otherwise these changes seem reasonable to me. @tdeverdiere have you tested these changes in a k8s cluster both with and without TLS?
} else { | ||
// For now just override the previous config. | ||
r.numConsumers = redisConfig.NumConsumers |
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 you return
in the if err != nil
block?
} | ||
|
||
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 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 you return
in the if err != nil
block?
@@ -95,7 +95,8 @@ 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 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 you return
in the if err != nil
block?
Fixes #626
Proposed Changes
Release Note
Docs
#626