Skip to content

Commit c071075

Browse files
author
tazhate
committed
fix: webhook path, CRD chain enum sync, batch script exit code
Three real bugs surfaced by the manual batch e2e workflow: 1. Webhook path mismatch — kubebuilder marker on ChainInstanceValidator still pointed at /validate-nodes-chainplane-io-... from the old nodes.k8s-bch.io group, so admission requests for chains routed by ValidatingWebhookConfiguration to /validate-chains-... got "the server could not find the requested resource". Renamed marker to match the new chains.chainplane.io group and regenerated config/webhook/manifests.yaml plus the chart's webhook template. 2. Chart CRD was out of sync — charts/chainplane/templates/crds/ chains.chainplane.io_chaininstances.yaml shipped an enum of 18 chains while the Go type lists 95. Re-vendored both chaininstances.yaml and chainversioncatalogs.yaml from config/crd/bases/ so the chart's enum matches the source of truth. 3. scripts/manual-batch-test.sh tallied failures inside a `{ ... } | tee` subshell, so `fail` was always 0 in the parent and the script exited 0 even when every batch failed. Split tee out and count failures in the parent shell. Context: gh run 25135219989 (the first sweep of all 103 samples) came back conclusion=success despite 103 FAIL rows in summary.txt. Pulled the artifact, grepped logs, found "Unsupported value" (CRD enum) and "failed calling webhook" (path), then traced the script bug from the exit-code anomaly. ~30min of investigation, ~10min of fixes.
1 parent 19ba7ad commit c071075

5 files changed

Lines changed: 204 additions & 69 deletions

File tree

api/v1alpha2/chaininstance_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (r *ChainInstance) SetupWebhookWithManager(mgr ctrl.Manager) error {
197197
}
198198

199199
// ChainInstanceValidator implements webhook.CustomValidator for ChainInstance.
200-
// +kubebuilder:webhook:path=/validate-nodes-chainplane-io-v1alpha2-chaininstance,mutating=false,failurePolicy=fail,sideEffects=None,groups=chains.chainplane.io,resources=chaininstances,verbs=create;update,versions=v1alpha2,name=vchaininstance.kb.io,admissionReviewVersions=v1
200+
// +kubebuilder:webhook:path=/validate-chains-chainplane-io-v1alpha2-chaininstance,mutating=false,failurePolicy=fail,sideEffects=None,groups=chains.chainplane.io,resources=chaininstances,verbs=create;update,versions=v1alpha2,name=vchaininstance.kb.io,admissionReviewVersions=v1
201201
type ChainInstanceValidator struct{}
202202

203203
var _ webhook.CustomValidator = &ChainInstanceValidator{}

0 commit comments

Comments
 (0)