You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
Possible Fix
I think the CRD is not consistent with the operator code as both caConfigMapRef and caCertificateSecretRef 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.
taham0
changed the title
[BUG] mongodb-community-operator: Operator crashes when tls is enabled
[BUG] mongodb-kubernetes-operator: Operator crashes when tls is enabled
Jul 19, 2022
Essoz
changed the title
[BUG] mongodb-kubernetes-operator: Operator crashes when tls is enabled
[BUG] mongodb-kubernetes-operator: Operator crashes with an incomplete TLS configuration
Jul 19, 2022
Essoz
changed the title
[BUG] mongodb-kubernetes-operator: Operator crashes with an incomplete TLS configuration
[BUG] mongodb-kubernetes-operator: Operator crashes in face of an incomplete TLS configuration
Jul 19, 2022
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: