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
{{ message }}
This repository was archived by the owner on Dec 12, 2025. It is now read-only.
Fix validation of references to CA certificate in TLS config (#1119)
* Fix validation of references to CA certificate in TLS config
Fixes#1114 on GH.
* convert tests to table driven
* Fix incorrect test fixtures without CAcert values
* reuse mgr in reconciler
return"", fmt.Errorf("TLS field requires a reference to the CA certificate which signed the server certificates. Neither secret (field caCertificateSecretRef) not configMap (field CaConfigMap) reference present")
assert.Contains(t, err.Error(), `if all of "tls.crt", "tls.key" and "tls.pem" are present in the secret, the entry for "tls.pem" must be equal to the concatenation of "tls.crt" with "tls.key"`)
"Success if reference to CA cert provided via secret": {
343
+
caConfigMap: &mdbv1.LocalObjectReference{
344
+
Name: "certificateKeySecret"},
345
+
caCertificateSecret: nil,
346
+
},
347
+
"Success if reference to CA cert provided via config map": {
348
+
caConfigMap: nil,
349
+
caCertificateSecret: &mdbv1.LocalObjectReference{
350
+
Name: "caConfigMap"},
351
+
},
352
+
"Succes if reference to CA cert provided both via secret and configMap": {
353
+
caConfigMap: &mdbv1.LocalObjectReference{
354
+
Name: "certificateKeySecret"},
355
+
caCertificateSecret: &mdbv1.LocalObjectReference{
356
+
Name: "caConfigMap"},
357
+
},
358
+
"Failure if reference to CA cert is missing": {
359
+
caConfigMap: nil,
360
+
caCertificateSecret: nil,
361
+
expectedError: errors.New("TLS field requires a reference to the CA certificate which signed the server certificates. Neither secret (field caCertificateSecretRef) not configMap (field CaConfigMap) reference present"),
0 commit comments