Commit d7d2e08
refactor: extract dereference/validate pipeline from reconcile (#824)
* refactor: rename druid_controller module to controller
Frees up the `controller/` directory for upcoming dereference and validate
submodules, matching the trino-operator layout.
No behavior change.
* refactor: extract dereference step from reconcile
Move all pre-loop client I/O (ZK ConfigMap, OPA URL, S3 connection, deep
storage bucket, AuthenticationClasses) into a new
`controller::dereference` submodule that returns `DereferencedObjects`.
Matches the trino-operator pattern (trino-operator commit 7004062).
No behavior change.
* refactor: extract validate step from reconcile
Move pure validation (product image resolution, TLS security construction,
authentication config conversion, product-config validation) into a new
`controller::validate` submodule that returns `ValidatedInputs`.
Matches the trino-operator pattern (trino-operator commit 7004062).
No behavior change.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: update stale druid_controller.rs reference
Follow-up to the druid_controller → controller module rename.
* fix: run fmt
* refactor(tests): scope 50-assert to cluster readiness only
Move the StatefulSet and PodDisruptionBudget shape assertions into
the upcoming 52-assert (resource shape) so that 50-assert mirrors
trino-operator's 10-assert (readiness-only). The duplicated broker
PDB and missing coordinator PDB will be corrected in 52-assert.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(smoke): add 52-assert shape checks for druid resources
Declarative shape assertions for every operator-managed druid
resource in the smoke test (5 StatefulSets, 3 ClusterIP + 5 headless
Services, 3 Listeners, 5 PDBs, the shared internal Secret, the
ServiceAccount, and the RoleBinding). Mirrors trino's 13-assert
and kafka's 33-assert.yaml.j2 patterns. The duplicative *-metrics
Services are intentionally not asserted.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(smoke): tighten 52-assert volume + selector assertions
Fill in the bare log-config/log volume entries on the historical
StatefulSet so the assertion matches the live shape, and add the
selector blocks on the five headless Services (mirrors the
trino/kafka equivalents). Also clarify the vector_enabled comment.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(smoke): add 53-assert discovery cm + secret snapshot
First slice of the ConfigMap snapshot assertion: the discovery
ConfigMap and the operator-managed Secret's key presence. The five
role-group ConfigMap snapshots follow in the next commit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(smoke): snapshot all five role-group ConfigMaps
Adds full .data snapshots for druid-{broker,coordinator,historical,
middlemanager,router}-default ConfigMaps. The actual side is
normalized for namespace and the random znode UUID before diffing.
The current snapshot was captured with VECTOR_AGGREGATOR unset.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(smoke): drop unused vector_enabled scaffolding from 52-assert
vector_enabled was declared in 52-assert.yaml.j2 as forward
scaffolding but has no consumer. Drop it; it can be re-introduced
in the commit that actually uses it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(smoke): cover all five roles in 51-assert containerdebug check
The previous check listed druid-router-default-0 twice and never
checked druid-broker-default-0. Replace the duplicate with the
broker entry and sort the list by role name for readability.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(smoke): add vector_enabled branch to role-group cm snapshot
When VECTOR_AGGREGATOR is set, the operator adds a vector.yaml key
to each role-group ConfigMap; the other four keys are unchanged.
The vector.yaml payload is the same across all five roles except
for a single `.role = "<role>"` line, so the content is declared
once via a jinja2 `{% set %}` block and substituted per role inside
the heredoc.
Verified against a live VECTOR_AGGREGATOR=vector-aggregator-discovery
cluster in namespace kuttl-test-distinct-camel.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(tests): place vector_enabled conditional at column 0
The `{% if vector_enabled -%}` and `{%- endif %}` blocks had
6 leading spaces. When vector_enabled was false, jinja2's strip
markers joined the leading whitespace of both blocks, putting
YAMLEOF at 12 spaces in the rendered output. After the kuttl
YAML block scalar strips 6 common-leading spaces, YAMLEOF ended
up at 6 spaces inside the script body, but the heredoc opener
is `<<'YAMLEOF'` (not `<<-`), which requires the terminator at
column 0. The heredoc therefore never closed and `\$(...)` never
terminated, producing `Syntax error: end of file unexpected
(expecting ")")` from dash.
Moving `{% if %}` and `{% endif %}` to column 0 (no strip markers)
mirrors kafka-operator's 34-assert.yaml.j2 pattern and renders
both branches with YAMLEOF at the correct indent.
Verified:
- non-vector render: 8 scripts pass against
kuttl-test-fluent-mastodon
- vector render heredoc parses to the 5 expected keys
(jvm.config, log4j2.properties, runtime.properties,
security.properties, vector.yaml)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: adapt changelog
* fix(test): make configmap diff better readable
* move dereferenced fields to validated struct
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Andrew Kenworthy <andrew.kenworthy@stackable.tech>1 parent 68a2442 commit d7d2e08
11 files changed
Lines changed: 1995 additions & 312 deletions
File tree
- rust/operator-binary/src
- controller
- crd
- operations
- tests/templates/kuttl/smoke
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
Lines changed: 39 additions & 164 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 29 | + | |
34 | 30 | | |
35 | 31 | | |
36 | 32 | | |
| |||
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
52 | | - | |
53 | 48 | | |
54 | 49 | | |
55 | 50 | | |
| |||
77 | 72 | | |
78 | 73 | | |
79 | 74 | | |
80 | | - | |
81 | 75 | | |
82 | 76 | | |
83 | 77 | | |
| |||
92 | 86 | | |
93 | 87 | | |
94 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
95 | 92 | | |
96 | 93 | | |
97 | 94 | | |
98 | | - | |
| 95 | + | |
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
| |||
139 | 136 | | |
140 | 137 | | |
141 | 138 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | 139 | | |
153 | 140 | | |
154 | 141 | | |
155 | 142 | | |
156 | 143 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 144 | + | |
| 145 | + | |
177 | 146 | | |
178 | 147 | | |
179 | 148 | | |
180 | 149 | | |
181 | 150 | | |
182 | 151 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | 152 | | |
200 | 153 | | |
201 | 154 | | |
| |||
245 | 198 | | |
246 | 199 | | |
247 | 200 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | 201 | | |
252 | 202 | | |
253 | 203 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | 204 | | |
260 | 205 | | |
261 | 206 | | |
| |||
363 | 308 | | |
364 | 309 | | |
365 | 310 | | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 311 | + | |
| 312 | + | |
370 | 313 | | |
371 | 314 | | |
372 | 315 | | |
| |||
394 | 337 | | |
395 | 338 | | |
396 | 339 | | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | 340 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 341 | + | |
415 | 342 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 343 | + | |
424 | 344 | | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
475 | 349 | | |
476 | | - | |
477 | | - | |
478 | 350 | | |
479 | | - | |
| 351 | + | |
480 | 352 | | |
481 | 353 | | |
482 | 354 | | |
| |||
510 | 382 | | |
511 | 383 | | |
512 | 384 | | |
513 | | - | |
| 385 | + | |
514 | 386 | | |
515 | 387 | | |
516 | 388 | | |
| |||
533 | 405 | | |
534 | 406 | | |
535 | 407 | | |
536 | | - | |
| 408 | + | |
537 | 409 | | |
538 | 410 | | |
539 | 411 | | |
| |||
548 | 420 | | |
549 | 421 | | |
550 | 422 | | |
551 | | - | |
| 423 | + | |
552 | 424 | | |
553 | 425 | | |
554 | 426 | | |
| |||
565 | 437 | | |
566 | 438 | | |
567 | 439 | | |
568 | | - | |
| 440 | + | |
569 | 441 | | |
570 | 442 | | |
571 | 443 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
578 | 450 | | |
579 | 451 | | |
580 | 452 | | |
581 | | - | |
| 453 | + | |
582 | 454 | | |
583 | 455 | | |
584 | 456 | | |
585 | 457 | | |
586 | | - | |
587 | | - | |
588 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
589 | 461 | | |
590 | 462 | | |
591 | 463 | | |
| |||
628 | 500 | | |
629 | 501 | | |
630 | 502 | | |
631 | | - | |
| 503 | + | |
632 | 504 | | |
633 | 505 | | |
634 | 506 | | |
635 | 507 | | |
636 | 508 | | |
637 | 509 | | |
638 | | - | |
| 510 | + | |
639 | 511 | | |
640 | 512 | | |
641 | 513 | | |
| |||
649 | 521 | | |
650 | 522 | | |
651 | 523 | | |
652 | | - | |
653 | | - | |
| 524 | + | |
| 525 | + | |
654 | 526 | | |
655 | 527 | | |
656 | 528 | | |
| |||
1387 | 1259 | | |
1388 | 1260 | | |
1389 | 1261 | | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1390 | 1265 | | |
1391 | 1266 | | |
1392 | | - | |
| 1267 | + | |
1393 | 1268 | | |
1394 | 1269 | | |
1395 | 1270 | | |
| |||
0 commit comments