You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(kustomize/v2, go/v4): Fix ca injection for conversion webhooks
The CA injection patch has **not** worked for `go/v4` and `kustomize/v2` (release `3.5.0`) due to the need to replace `vars` with `replacements`, as `vars` are no longer supported in the latest major versions of Kustomize.
However, since webhook `--conversion` was an incomplete feature until the upcoming Kubebuilder future release `v4.4.0` (where [PR #4254](#4254) is expected to be merged), users likely didn’t encounter this issue or addressed it manually by fixing the scaffold.
**Note:** This change only affects projects that require a **conversion webhook**.
Copy file name to clipboardExpand all lines: docs/book/src/reference/markers/scaffold.md
+58-1
Original file line number
Diff line number
Diff line change
@@ -103,10 +103,67 @@ properly registered with the manager, so that the controller can reconcile the r
103
103
|`+kubebuilder:scaffold:webhook`|`webhooks suite tests` files | Marks where webhook setup functions are added. |
104
104
|`+kubebuilder:scaffold:crdkustomizeresource`|`config/crd`| Marks where CRD custom resource patches are added. |
105
105
|`+kubebuilder:scaffold:crdkustomizewebhookpatch`|`config/crd`| Marks where CRD webhook patches are added. |
106
-
|`+kubebuilder:scaffold:crdkustomizecainjectionpatch`|`config/crd`| Marks where CA injection patches are added for the webhook. |
106
+
|`+kubebuilder:scaffold:crdkustomizecainjectionns`|`config/default`| Marks where CA injection patches are added for the conversion webhooks. |
107
+
|`+kubebuilder:scaffold:crdkustomizecainjectioname`|`config/default`| Marks where CA injection patches are added for the conversion webhooks. |
108
+
|**(No longer supported)**`+kubebuilder:scaffold:crdkustomizecainjectionpatch`|`config/crd`| Marks where CA injection patches are added for the webhooks. Replaced by `+kubebuilder:scaffold:crdkustomizecainjectionns` and `+kubebuilder:scaffold:crdkustomizecainjectioname`|
107
109
|`+kubebuilder:scaffold:manifestskustomizesamples`|`config/samples`| Marks where Kustomize sample manifests are injected. |
108
110
|`+kubebuilder:scaffold:e2e-webhooks-checks`|`test/e2e`| Adds e2e checks for webhooks depending on the types of webhooks scaffolded. |
3.**Ensure Only Conversion Webhook Patches in `config/crd/patches`:**
156
+
157
+
The `config/crd/patches` directory and the corresponding entries in `config/crd/kustomization.yaml` should only contain files for conversion webhooks. Previously, a bug caused the patch file to be generated for any webhook, but only patches for webhooks scaffolded with the `--conversion` option should be included.
158
+
159
+
For further guidance, you can refer to examples in the `testdata/` directory in the Kubebuilder repository.
160
+
161
+
> **Alternatively**: You can use the [`alpha generate`](./../rescaffold.md) command to re-generate the project from scratch
162
+
> using the latest release available. Afterward, you can re-add only your code implementation on top to ensure your project
163
+
> includes all the latest bug fixes and enhancements.
0 commit comments