Commit 330c11e
authored
Search: remove external.tls.enabled (#442)
# Summary
This pull request refactors the TLS configuration for MongoDB Search
resources by removing the `enabled` boolean flag and relying solely on
the presence or absence of TLS configuration objects to determine if TLS
should be enabled. It also updates the CRD schemas, controller logic,
tests, and documentation to reflect this change, and clarifies the usage
of CA certificates for external mongod sources.
**API and CRD schema changes:**
* Removed the `enabled` boolean from both `spec.security.tls` and
`spec.source.external.tls`, making TLS activation dependent on whether
the TLS configuration is provided. Updated required fields and
descriptions for CA certificates in the CRDs
(`config/crd/bases/mongodb.com_mongodbsearch.yaml`,
`helm_chart/crds/mongodb.com_mongodbsearch.yaml`, `public/crds.yaml`).
[[1]](diffhunk://#diff-8621604e23ddaa9863d6c6e98dda3f3b71bd29740cdab99b8b3fa32177f4c89eL182-R183)
[[2]](diffhunk://#diff-8621604e23ddaa9863d6c6e98dda3f3b71bd29740cdab99b8b3fa32177f4c89eL214-R213)
[[3]](diffhunk://#diff-8621604e23ddaa9863d6c6e98dda3f3b71bd29740cdab99b8b3fa32177f4c89eL228-R227)
[[4]](diffhunk://#diff-dba1285752e5d0324f36d8c959e29913fcbf02c90263cdd7d6d96447180bbe8dL4204-R4205)
[[5]](diffhunk://#diff-dba1285752e5d0324f36d8c959e29913fcbf02c90263cdd7d6d96447180bbe8dL4236-R4235)
[[6]](diffhunk://#diff-dba1285752e5d0324f36d8c959e29913fcbf02c90263cdd7d6d96447180bbe8dL4250-R4249)
* Updated the Go API types to remove the `Enabled` field from
`ExternalMongodTLS` and `TLS`, clarified CA certificate documentation,
and made `Security.TLS` an optional pointer.
(`api/v1/search/mongodbsearch_types.go`)
**Controller logic updates:**
* Refactored controller code to check for the presence of TLS
configuration objects instead of the `Enabled` flag when determining TLS
behavior in reconciliation and config generation.
(`controllers/operator/mongodbsearch_controller.go`,
`controllers/searchcontroller/external_search_source.go`,
`controllers/searchcontroller/mongodbsearch_reconcile_helper.go`)
[[1]](diffhunk://#diff-ff8b89a9eaadf42605cba2f2884310f60e46bf00162ef5e0173a8d34d1fb466dL73-R73)
[[2]](diffhunk://#diff-0f0be42909b701181f9550c76be0b3bcf63ed7c2825a51bbbfc098006c88fc1eL29-R29)
[[3]](diffhunk://#diff-9b1183581cc6af6723f6445d7a14ae4ae7b435dc3b93ca5d82247cda13f7ca39L231-R231)
[[4]](diffhunk://#diff-9b1183581cc6af6723f6445d7a14ae4ae7b435dc3b93ca5d82247cda13f7ca39L393-R393)
**Test and documentation updates:**
* Updated tests and documentation to remove references to the `enabled`
field in TLS configurations and to use the new structure.
(`docker/mongodb-kubernetes-tests/tests/search/search_community_external_mongod_basic.py`,
`docker/mongodb-kubernetes-tests/tests/search/search_community_external_mongod_tls.py`,
`docker/mongodb-kubernetes-tests/tests/search/search_enterprise_tls.py`,
`docs/search/04-search-external-mongod/README.md`,
`docs/search/04-search-external-mongod/code_snippets/04_0320_create_mongodb_search_resource.sh`)
[[1]](diffhunk://#diff-b2921000399e050cf60a6d3c4abbb21a0c6a9484af6cd4857b6a3217c0a36d1cL74)
[[2]](diffhunk://#diff-83229428104eb15a5b4108d84eae1dce6c34940aae703481c902b52e020f1a32L141-R148)
[[3]](diffhunk://#diff-7ac66a583299039225a2f886ef60cd00a230029416d6d809e4e68b4d55edc29bL62-R62)
[[4]](diffhunk://#diff-78a9bbf913195ad01e7814be0a2937858af6c019f895fa45726b5730974bc78cL185-L186)
[[5]](diffhunk://#diff-17ce6ba340db65b4ae7338b809e03258b9e0cf148f4894872fb0dcefd2c41c4cL16-L17)
**Evergreen build changes:**
* Added a new Evergreen task and included it in the relevant task group
to test external mongod search code snippets.
(`.evergreen-snippets.yml`)
[[1]](diffhunk://#diff-567852169488d3138501958aeebe87ca49e1c19b4b2d5a746e52c93b0fd4dc0eR124-R129)
[[2]](diffhunk://#diff-567852169488d3138501958aeebe87ca49e1c19b4b2d5a746e52c93b0fd4dc0eR144)
## Proof of Work
Tests pass1 parent cb20e63 commit 330c11e
File tree
15 files changed
+29
-42
lines changed- api/v1/search
- config/crd/bases
- controllers
- operator
- searchcontroller
- docker/mongodb-kubernetes-tests/tests/search
- docs/search/04-search-external-mongod
- code_snippets
- helm_chart/crds
- public
- scripts/code_snippets/tests
15 files changed
+29
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| |||
135 | 141 | | |
136 | 142 | | |
137 | 143 | | |
| 144 | + | |
138 | 145 | | |
139 | 146 | | |
140 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | | - | |
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
184 | 182 | | |
185 | | - | |
| 183 | + | |
186 | 184 | | |
187 | 185 | | |
188 | 186 | | |
| |||
211 | 209 | | |
212 | 210 | | |
213 | 211 | | |
214 | | - | |
215 | | - | |
| 212 | + | |
| 213 | + | |
216 | 214 | | |
217 | 215 | | |
218 | 216 | | |
| |||
225 | 223 | | |
226 | 224 | | |
227 | 225 | | |
228 | | - | |
229 | | - | |
230 | 226 | | |
231 | | - | |
| 227 | + | |
232 | 228 | | |
233 | 229 | | |
234 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
148 | 147 | | |
149 | | - | |
| 148 | + | |
150 | 149 | | |
151 | 150 | | |
152 | 151 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
| |||
0 commit comments