Merge pull request #846 from bjschafer/fix-crds

Fix CRDs missing metadata fields
This commit is contained in:
Kubernetes Prow Robot
2023-10-27 12:41:55 +02:00
committed by GitHub
7 changed files with 18 additions and 16 deletions

View File

@@ -66,16 +66,6 @@ Follow these steps to update the CRD:
* Add api-approved.kubernetes.io annotation value in all yaml files in the metadata section with the PR where the API is approved by the API reviewers. The current approved PR for snapshot v1 API is https://github.com/kubernetes-csi/external-snapshotter/pull/419. Refer to https://github.com/kubernetes/enhancements/pull/1111 for details about this annotation.
* Remove any metadata sections from the yaml file which does not belong to the generated type.
For example, the following command will add a metadata section for a nested object, remove any newly added metadata sections. TODO(xiangqian): this is to make sure the generated CRD is compatible with apiextensions.k8s.io/v1. Once controller-gen supports generating CRD with apiextensions.k8s.io/v1, switch to use the correct version of controller-gen and remove the last step from this README.
```bash
./hack/update-crd.sh; git diff
+ metadata:
+ description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
type: object
```
* Update the restoreSize property to string in snapshot.storage.k8s.io_volumesnapshots.yaml
The generated yaml file contains restoreSize property anyOf as described below: