Remove v1beta1 APIs and generated functions

This commit is contained in:
Raunak Pradip Shah
2022-05-10 16:11:21 +05:30
parent 3cf71378c2
commit 1c8e6b39b4
34 changed files with 99 additions and 3099 deletions

View File

@@ -54,8 +54,6 @@ Once you run the script, you will get an output as follows:
## update-crd.sh
NOTE: `v1beta1` APIs are deprecated and will be removed in a future release.
This is the script to update CRD yaml files under /client/config/crd/ based on types.go file.
Make sure to run this script after making changes to /client/apis/volumesnapshot/v1/types.go.
@@ -152,70 +150,4 @@ Update the restoreSize property to use type string only:
volumeSnapshotClassName:
```
* Because we need to serve both v1 and v1beta1 snapshot APIs, we need to make sure that both v1 and v1beta1 APIs are in the manifest yaml file. Because `update-crd.sh` only generates v1 manifest, make sure to copy the v1beta1 manifest below the v1 manifest after running `update-crd.sh` in the manifest yaml files. See `snapshot.storage.k8s.io_volumesnapshots.yaml` as an example. `served` is true for both v1beta1 and v1. `storage` is true for v1beta and false for v1.
```
spec:
group: snapshot.storage.k8s.io
names:
kind: VolumeSnapshot
listKind: VolumeSnapshotList
plural: volumesnapshots
singular: volumesnapshot
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Indicates if a snapshot is ready to be used to restore a volume.
jsonPath: .status.readyToUse
name: ReadyToUse
type: boolean
......
- description: Timestamp when the point-in-time snapshot is taken by the underlying storage system.
jsonPath: .status.creationTime
name: CreationTime
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
openAPIV3Schema:
description: VolumeSnapshot is a user's request for either creating a point-in-time snapshot of a persistent volume, or binding to a pre-existing snapshot.
properties:
......
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- description: Indicates if a snapshot is ready to be used to restore a volume.
jsonPath: .status.readyToUse
name: ReadyToUse
type: boolean
......
- description: Timestamp when the point-in-time snapshot is taken by the underlying storage system.
jsonPath: .status.creationTime
name: CreationTime
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: VolumeSnapshot is a user's request for either creating a point-in-time snapshot of a persistent volume, or binding to a pre-existing snapshot.
properties:
......
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
``````
* Add the VolumeSnapshot namespace to the `additionalPrinterColumns` section. Refer https://github.com/kubernetes-csi/external-snapshotter/pull/535 for more details.

View File

@@ -24,10 +24,9 @@ SCRIPT_ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
# We should only be generating code for v1 now, while keeping the existing generated code for v1beta1
${GOPATH}/src/k8s.io/code-generator/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/kubernetes-csi/external-snapshotter/client/v6 github.com/kubernetes-csi/external-snapshotter/client/v6/apis \
volumesnapshot:v1beta1,v1 \
volumesnapshot:v1 \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
# To use your own boilerplate text use: