Commit ff5d781
feat: optional Gateway API HTTPRoute for HermesInstance (#59)
## Summary
Adds optional Gateway API HTTPRoute support to `HermesInstance`,
mirroring paperclip-operator and the existing Ingress spec shape for
consistency. This is a Tier 3 cross-pollination change built on
`feat/parity-tier12`.
- New `spec.networking.httpRoute` (`*HTTPRouteSpec`): `enabled`,
`parentRefs` (`name`/`namespace`/`sectionName`), `hostnames`, `path`,
`servicePortName`, `annotations`. Defaults off.
- New `internal/resources/httproute.go` `BuildHTTPRoute`: builds an
**unstructured** `gateway.networking.k8s.io/v1` HTTPRoute (no
`sigs.k8s.io/gateway-api` dependency, following the
`BuildServiceMonitor` pattern). A single `PathPrefix` rule routes to the
agent Service; the named service port is resolved to its port number for
the backendRef.
- Controller: `reconcileHTTPRoute` step using
`controllerutil.CreateOrUpdate` over an unstructured object, deleting
the route when disabled, reporting via a new `HTTPRouteReady` condition.
- Tolerates clusters without the Gateway API CRDs: when `httpRoute` is
unset (default), the disabled path swallows the "no matches for kind"
error so users are not forced to install Gateway API. Enabling
`httpRoute` without the CRDs surfaces the error via
`HTTPRouteReady=False`.
- `+kubebuilder:rbac` for `gateway.networking.k8s.io/httproutes`;
regenerated `config/rbac/role.yaml` and kept the Helm chart ClusterRole
in sync (Helm RBAC Sync check passes).
- Regenerated CRDs (config + Helm chart copy), deepcopy, and generated
API reference.
- Unit tests for the pure builder; docs in `api-reference.md` and
`conditions.md`.
Note: `bundle/` and `config/webhook` are intentionally untouched (a
concurrent OLM webhook fix owns those off `main`); `sync-bundle-crds`
was therefore not run here.
## Validation
- `go build ./...`, `go vet ./...`: clean
- `make lint` (golangci-lint v2.12.2): 0 issues
- `go test ./internal/resources/... ./api/...`: pass (resources coverage
90.9%)
- `make test` (envtest): controller suite passes (27/27, ~28s) after the
Gateway-API-CRD tolerance fix
- `hack/check-helm-rbac.sh`, `helm lint`, `hack/reconcile-guard.sh`:
pass
- dash scan `grep -rnP '[\x{2013}\x{2014}]'` on changed files: clean
DO NOT MERGE / no auto-merge per task instructions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c81dfd6 commit ff5d781
13 files changed
Lines changed: 629 additions & 15 deletions
File tree
- api/v1
- bundle/manifests
- charts/hermes-operator/templates
- crds
- config
- crd/bases
- rbac
- docs
- internal
- controller
- resources
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
452 | 509 | | |
453 | 510 | | |
454 | 511 | | |
| |||
1057 | 1114 | | |
1058 | 1115 | | |
1059 | 1116 | | |
| 1117 | + | |
1060 | 1118 | | |
1061 | 1119 | | |
1062 | 1120 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
122 | | - | |
123 | | - | |
| 120 | + | |
124 | 121 | | |
125 | 122 | | |
126 | 123 | | |
| |||
129 | 126 | | |
130 | 127 | | |
131 | 128 | | |
| 129 | + | |
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
| 133 | + | |
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
| 147 | + | |
145 | 148 | | |
146 | 149 | | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
| 153 | + | |
149 | 154 | | |
150 | 155 | | |
151 | 156 | | |
| |||
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| 198 | + | |
193 | 199 | | |
194 | 200 | | |
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
| 205 | + | |
199 | 206 | | |
200 | 207 | | |
201 | 208 | | |
| |||
251 | 258 | | |
252 | 259 | | |
253 | 260 | | |
254 | | - | |
255 | | - | |
| 261 | + | |
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
| |||
387 | 393 | | |
388 | 394 | | |
389 | 395 | | |
390 | | - | |
391 | | - | |
| 396 | + | |
392 | 397 | | |
393 | 398 | | |
394 | 399 | | |
| |||
420 | 425 | | |
421 | 426 | | |
422 | 427 | | |
423 | | - | |
424 | | - | |
| 428 | + | |
425 | 429 | | |
426 | 430 | | |
427 | 431 | | |
| |||
443 | 447 | | |
444 | 448 | | |
445 | 449 | | |
446 | | - | |
| 450 | + | |
447 | 451 | | |
448 | 452 | | |
449 | 453 | | |
| |||
460 | 464 | | |
461 | 465 | | |
462 | 466 | | |
463 | | - | |
| 467 | + | |
464 | 468 | | |
465 | 469 | | |
466 | 470 | | |
| |||
505 | 509 | | |
506 | 510 | | |
507 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
508 | 524 | | |
509 | 525 | | |
510 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4641 | 4641 | | |
4642 | 4642 | | |
4643 | 4643 | | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
| 4662 | + | |
| 4663 | + | |
| 4664 | + | |
| 4665 | + | |
| 4666 | + | |
| 4667 | + | |
| 4668 | + | |
| 4669 | + | |
| 4670 | + | |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
| 4679 | + | |
| 4680 | + | |
| 4681 | + | |
| 4682 | + | |
| 4683 | + | |
| 4684 | + | |
| 4685 | + | |
| 4686 | + | |
| 4687 | + | |
| 4688 | + | |
| 4689 | + | |
| 4690 | + | |
| 4691 | + | |
| 4692 | + | |
| 4693 | + | |
| 4694 | + | |
| 4695 | + | |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
| 4703 | + | |
4644 | 4704 | | |
4645 | 4705 | | |
4646 | 4706 | | |
| |||
0 commit comments