-
Notifications
You must be signed in to change notification settings - Fork 517
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
Operator crashes in face of an incomplete TLS configuration #1054
Comments
This issue is being marked stale because it has been open for 60 days with no activity. Please comment if this issue is still affecting you. If there is no change, this issue will be closed in 30 days. |
Remove stale |
Closed via #1115 |
Hi, I'm Dan and I'm the Product Manager for MongoDB's support of Kubernetes. I'm doing some work right now to try and identify how the Community Operator is being used. The Community Operator is something I inherited when I started at MongoDB, but it doesn't get as much attention from us as we'd like and we're trying to understand how it's used in order to establish its future. It will help us prioritize future issues and PRs raised by the community 🙂 Here's a super short survey (it's much easier for us to review all the feedback that way!): https://docs.google.com/forms/d/e/1FAIpQLSfwrwyxBSlUyJ6AmC-eYlgW_3JEdfA48SB2i5--_WpiynMW2w/viewform?usp=sf_link If you'd rather email me instead: [email protected] Thank you in advance! |
What did you do to encounter the bug?
I enabled TLS with a very incomplete TLS configuration. The operator crashed when
Ensuring TLS is correctly configured
.Steps to reproduce the behavior:
What did you expect?
The operator does not crash and it can also report an error/warning for incomplete input.
What happened instead?
The operator crashes with the following message:
Operator Information
0.7.3
4.4.0
Kubernetes Cluster Information
kubectl version --short --output=yaml
Additional context
It seems that this null pointer exception occurs while ensuring that the CA cert is configured during TLS config validation when the following condition is checked:
Since
Spec.Security.TLS.CaCertificateSecret
is set to nil,mdb.TLSConfigMapNamespacedName
is called:However,
Spec.Security.TLS.CaConfigMap
is also nil, so when theName
field is accessed a runtime error occurs as a nil pointer is dereferenced.Additional Information (description/logs)
kubectl describe
outputPossible Fix
I think the CRD is not consistent with the operator code as both
caConfigMapRef
andcaCertificateSecretRef
are optional in the CRD. However, the operator expects one of them to be present while validating the TLS config. We can make changes to the CRD or we can also consider the following alternative fix.Currently, there is no validation for TLS spec:
I think we can include the following condition in the above code along with the function definition in
controllers/validation/validation.go
:The text was updated successfully, but these errors were encountered: