Skip to content

Commit d8ff17b

Browse files
author
kartik494
committed
Update README
1 parent ae21521 commit d8ff17b

File tree

2 files changed

+39
-17
lines changed

2 files changed

+39
-17
lines changed

hack/README.md

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ This is the script to update clientset/informers/listers and API deepcopy code u
1010

1111
Make sure to run this script after making changes to /client/apis/volumesnapshot/v1beta1/types.go.
1212

13-
To run this script, Run: ./hack/update-generated-code.sh from the project root directory.
13+
Run: ./hack/update-generated-code.sh from the project root directory.
1414

15-
Once you run the script, you got the output as:
15+
Once you run the script, you will get an output as follows:
1616
```bash
1717
Generating deepcopy funcs
18-
Generating clientset for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/v2/clientset
19-
Generating listers for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/v2/listers
20-
Generating informers for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/v2/informers
18+
Generating clientset for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/clientset
19+
Generating listers for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/listers
20+
Generating informers for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/informers
2121

2222
```
2323

@@ -30,7 +30,7 @@ Make sure to run this script after making changes to /client/apis/volumesnapshot
3030

3131
Follow these steps to update the CRD:
3232

33-
* Run ./hack/update-crd.sh from client directory, new yaml files should have been created under ./config/crd/
33+
* Run ../hack/update-crd.sh from client directory, new yaml files should have been created under ./config/crd/
3434

3535
* 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 beta API is https://github.com/kubernetes-csi/external-snapshotter/pull/139. Refer to https://github.com/kubernetes/enhancements/pull/1111 for details about this annotation.
3636

@@ -43,17 +43,39 @@ For example, the following command will add a metadata section for a nested obje
4343
```
4444
* Update the restoreSize property to string in snapshot.storage.k8s.io_volumesnapshots.yaml
4545

46+
The generated yaml file contains restoreSize property anyOf as described below:
47+
4648
```bash
47-
48-
@@ -160,7 +157,7 @@ spec:
49-
of a snapshot is unknown.
50-
type: boolean
51-
restoreSize:
52-
- - type: string
53-
+ type: string
54-
description: restoreSize represents the complete size of the snapshot
55-
in bytes. In dynamic snapshot creation case, this field will be filled
56-
in with the "size_bytes" value returned from CSI "CreateSnapshotRequest"
49+
restoreSize:
50+
anyOf:
51+
- type: integer
52+
- type: string
53+
description: restoreSize represents the complete size of the snapshot
54+
in bytes. In dynamic snapshot creation case, this field will be filled
55+
in with the "size_bytes" value returned from CSI "CreateSnapshotRequest"
56+
gRPC call. For a pre-existing snapshot, this field will be filled
57+
with the "size_bytes" value returned from the CSI "ListSnapshots"
58+
gRPC call if the driver supports it. When restoring a volume from
59+
this snapshot, the size of the volume MUST NOT be smaller than the
60+
restoreSize if it is specified, otherwise the restoration will fail.
61+
If not specified, it indicates that the size is unknown.
62+
```
63+
64+
Update the restoreSize property to use type string only:
65+
66+
```bash
67+
68+
restoreSize:
69+
type: string
70+
description: restoreSize represents the complete size of the snapshot
71+
in bytes. In dynamic snapshot creation case, this field will be filled
72+
in with the "size_bytes" value returned from CSI "CreateSnapshotRequest"
73+
gRPC call. For a pre-existing snapshot, this field will be filled
74+
with the "size_bytes" value returned from the CSI "ListSnapshots"
75+
gRPC call if the driver supports it. When restoring a volume from
76+
this snapshot, the size of the volume MUST NOT be smaller than the
77+
restoreSize if it is specified, otherwise the restoration will fail.
78+
If not specified, it indicates that the size is unknown.
5779

5880
```
5981

hack/update-generated-code.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-ge
2727
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
2828
# instead of the $GOPATH directly. For normal projects this can be dropped.
2929
bash ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
30-
github.com/kubernetes-csi/external-snapshotter/client/v2 github.com/kubernetes-csi/external-snapshotter/client/v2/apis \
30+
github.com/kubernetes-csi/external-snapshotter/client github.com/kubernetes-csi/external-snapshotter/client/v2/apis \
3131
volumesnapshot:v1beta1 \
3232
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
3333

0 commit comments

Comments
 (0)