Skip to content

fix(olm): declare webhookDefinitions so OLM provisions the webhook cert - #57

Merged
stubbi merged 2 commits into
mainfrom
fix/olm-webhookdefinitions
Jun 3, 2026
Merged

fix(olm): declare webhookDefinitions so OLM provisions the webhook cert#57
stubbi merged 2 commits into
mainfrom
fix/olm-webhookdefinitions

Conversation

@stubbi

@stubbi stubbi commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Problem (kiwi crash root cause)

The hermes manager registers admission webhooks and serves TLS on the webhook server, but the bundle CSV declared no spec.webhookDefinitions:

  • RegisterHermesInstanceWebhook (mutating defaulter + validating)
  • RegisterHermesClusterDefaultsWebhook (validating)
  • RegisterHermesSelfConfigWebhook (validating)

Under OLM there is no cert-manager. OLM only provisions the webhook serving cert and creates the ValidatingWebhookConfiguration/MutatingWebhookConfiguration when the CSV declares the webhooks in spec.webhookDefinitions. Without it the manager starts, tries to load its serving cert, and crashes:

open /tmp/k8s-webhook-server/serving-certs/tls.crt: no such file or directory

This produces a CrashLoopBackOff, and the OperatorHub "Full operator test" (kiwi) install fails. This is the real blocker keeping hermes off OperatorHub. (paperclip has no webhook; openclaw does not register/serve one, so only hermes hits this.)

Fix

Added a spec.webhookDefinitions list to the CSV with one entry per registered webhook, derived from config/webhook/manifests.yaml and the api/v1 +kubebuilder:webhook markers:

type generateName webhookPath resource
MutatingAdmissionWebhook mhermesinstance.hermes.agent /mutate-hermes-agent-v1-hermesinstance hermesinstances
ValidatingAdmissionWebhook vhermesinstance.hermes.agent /validate-hermes-agent-v1-hermesinstance hermesinstances
ValidatingAdmissionWebhook vhermesclusterdefaults.hermes.agent /validate-hermes-agent-v1-hermesclusterdefaults hermesclusterdefaults
ValidatingAdmissionWebhook vhermesselfconfig.hermes.agent /validate-hermes-agent-v1-hermesselfconfig hermesselfconfigs

All entries use admissionReviewVersions: [v1], containerPort: 443 / targetPort: 9443 (OLM convention to the controller-runtime default webhook port), deploymentName: hermes-operator-controller-manager, sideEffects: None, failurePolicy: Fail, and rules for CREATE/UPDATE on apiGroups: [hermes.agent], apiVersions: [v1].

Also exposed containerPort: 9443 (webhook-server) on the manager container so OLM can wire the generated webhook Service to the server.

The CSV's hand-maintained metadata (rich description, icon, keywords, links, alm-examples, specDescriptors) is preserved unchanged. The bundle make bundle target is a custom sync (it does not run operator-sdk generate bundle), so the webhookDefinitions block was hand-added per the OLM WebhookDescription schema rather than regenerated. The webhook details were taken directly from the kubebuilder-generated config/webhook/manifests.yaml; no markers or config/webhook were changed, so no make manifests/make generate regeneration was required.

Validation

  • operator-sdk bundle validate ./bundle --select-optional suite=operatorframework: All validation tests have completed successfully (the 2 pre-existing cronjobs v1.25 deprecation warnings are unchanged and unrelated).
  • CSV YAML parses cleanly.
  • go build ./...: clean.
  • ASCII-only dash scan on the changed file: clean.

Note on final validation

This cannot be fully validated via kiwi from a branch: kiwi needs a published release plus ~20min. Final validation happens via the next release's OperatorHub re-submission. This PR gets the CSV structurally correct per the OLM spec and operator-sdk bundle validate.

🤖 Generated with Claude Code

stubbi and others added 2 commits June 3, 2026 21:37
The hermes manager registers admission webhooks (RegisterHermesInstanceWebhook
mutating defaulter + validating, RegisterHermesClusterDefaultsWebhook,
RegisterHermesSelfConfigWebhook) and serves TLS on the webhook server (default
port 9443), but the bundle CSV declared no spec.webhookDefinitions.

Under OLM there is no cert-manager, so OLM only provisions the webhook serving
cert and creates the Validating/MutatingWebhookConfiguration when the CSV
declares the webhooks in spec.webhookDefinitions. Without it the manager crashes
with "open /tmp/k8s-webhook-server/serving-certs/tls.crt: no such file or
directory", CrashLoopBackOff, and the OperatorHub "Full operator test" (kiwi)
install fails. This is the real blocker keeping hermes off OperatorHub.

Add one webhookDefinitions entry per registered webhook (1 mutating, 3
validating) derived from config/webhook/manifests.yaml and the api/v1
+kubebuilder:webhook markers, plus expose containerPort 9443 (webhook-server) on
the manager container so OLM wires the service to the webhook server.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stubbi
stubbi merged commit 4420511 into main Jun 3, 2026
13 checks passed
@stubbi
stubbi deleted the fix/olm-webhookdefinitions branch June 3, 2026 20:22
stubbi added a commit that referenced this pull request Jun 3, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.1.12](v0.1.11...v0.1.12)
(2026-06-03)


### Features

* optional Gateway API HTTPRoute for HermesInstance
([#59](#59))
([ff5d781](ff5d781))
* tier-1/2 parity (digest-pin, bench, image CEL, zombie reaping,
Grafana, docs-site)
([#56](#56))
([712ed2b](712ed2b))


### Bug Fixes

* **olm:** declare webhookDefinitions so OLM provisions the webhook cert
([#57](#57))
([4420511](4420511))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: paperclip-release-bot[bot] <288053502+paperclip-release-bot[bot]@users.noreply.github.com>
Co-authored-by: Jannes Stubbemann <jannes.stubbemann@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant