Skip to content

Commit faa1efa

Browse files
committed
doc/user/migrating-existing-apis.md: document 'None' conversion, change conversion wording
1 parent 2fcc0e3 commit faa1efa

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

doc/user/migrating-existing-apis.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,18 @@ Steps to upgrade the above CRD:
310310

311311
The API server will validate each version by its own `schema` if the global `spec.validation` block is removed. No validation will be performed if a `schema` does not exist for a version and `spec.validation` does not exist.
312312

313-
If the CRD targets a Kubernetes 1.13+ cluster with the `CustomResourceWebhookConversion` feature enabled, converting between multiple versions can be done using a [conversion webhooks][crd-conv-webhook].
313+
If the CRD targets a Kubernetes 1.13+ cluster with the `CustomResourceWebhookConversion` feature enabled, converting between multiple versions can be done using a [conversion][crd-conv]. The `None` conversion is simple and useful when the CRD spec has not changed; it only updates the `apiVersion` field of custom resources:
314314

315-
_TODO:_ document adding and using conversion webhooks to migrate `v1` to `v2` once the SDK `controller-runtime` version is bumped to `v0.2.0` and [#1455](https://github.com/operator-framework/operator-sdk/pull/1455) is implemented.
315+
```yaml
316+
spec:
317+
...
318+
conversion:
319+
strategy: None
320+
```
321+
322+
More complex conversions can be done using [conversion webhooks][crd-conv-webhook].
323+
324+
_TODO:_ document adding and using conversion webhooks to migrate `v1` to `v2` once the SDK `controller-runtime` version is bumped to `v0.2.0`.
316325

317326
**Note:** read the [CRD versioning][crd-versions] docs for detailed CRD information, notes on conversion webhooks, and CRD versioning case studies.
318327

@@ -383,6 +392,7 @@ TODO
383392
[openapi-gen]:https://github.com/kubernetes/kube-openapi
384393
[controller-tools]:https://github.com/kubernetes-sigs/controller-tools
385394
[crd-versions]:https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning/
386-
[crd-conv-webhook]:https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning/#webhook-conversion
395+
[crd-conv]:https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning/#webhook-conversion
396+
[crd-conv-webhook]:https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning/#configure-customresourcedefinition-to-use-conversion-webhooks
387397
[kubebuilder-api-annotations]:https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
388398
[crd-version-deprecated]:https://github.com/kubernetes/apiextensions-apiserver/commit/d1c6536f26319513417b12245c6e3aee5ca005ca

0 commit comments

Comments
 (0)