Skip to content

Commit cb69191

Browse files
committed
more comment updates
VolumeSnapshot comments
1 parent ba6ec14 commit cb69191

File tree

3 files changed

+37
-39
lines changed

3 files changed

+37
-39
lines changed

config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml

+12-12
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ spec:
6868
This field is immutable after creation. Required.
6969
properties:
7070
snapshotHandle:
71-
description: snapshotHandle specifies the CSI name of a pre-existing
71+
description: snapshotHandle specifies the "snapshot_id" of a pre-existing
7272
snapshot on the underlying storage system. This field is immutable.
7373
type: string
7474
volumeHandle:
75-
description: volumeHandle specifies the CSI name of the volume from
76-
which a snapshot should be dynamically taken from. This field
75+
description: volumeHandle specifies the "volume_id" of the volume
76+
from which a snapshot should be dynamically taken from. This field
7777
is immutable.
7878
type: string
7979
type: object
@@ -133,9 +133,9 @@ spec:
133133
case, this field will be filled in with the "creation_time" value
134134
returned from CSI "CreateSnapshotRequest" gRPC call. For pre-existing
135135
snapshot, this field will be filled with the "creation_time" value
136-
returned from CSI "ListSnapshots" gRPC call if the CSI driver supports.
137-
The format of this field is a Unix nanoseconds time encoded as an
138-
int64. On Unix, the command `date +%s%N` returns the current time
136+
returned from the CSI "ListSnapshots" gRPC call if the driver supports
137+
it. The format of this field is a Unix nanoseconds time encoded as
138+
an int64. On Unix, the command `date +%s%N` returns the current time
139139
in nanoseconds since 1970-01-01 00:00:00 UTC.
140140
format: int64
141141
type: integer
@@ -158,19 +158,19 @@ spec:
158158
to restore a volume. In dynamic snapshot creation case, this field
159159
will be filled in with the "ready_to_use" value returned from CSI
160160
"CreateSnapshotRequest" gRPC call. For pre-existing snapshot, this
161-
field will be filled with the "read_to_use" value returned from CSI
162-
"ListSnapshots" gRPC call if the CSI driver supports. If not specified,
161+
field will be filled with the "ready_to_use" value returned from the
162+
CSI "ListSnapshots" gRPC call if the driver supports it. If not specified,
163163
it means the readiness of a snapshot is unknown.
164164
type: boolean
165165
restoreSize:
166166
description: restoreSize represents the complete size of the snapshot
167167
in bytes. In dynamic snapshot creation case, this field will be filled
168168
in with the "size_bytes" value returned from CSI "CreateSnapshotRequest"
169169
gRPC call. For pre-existing snapshot, this field will be filled with
170-
the "size_bytes" value returned from CSI "ListSnapshots" gRPC call
171-
if the CSI driver supports. When restoring a volume from this snapshot,
172-
the size of the volume MUST NOT be smaller than the restoreSize if
173-
it is specified. Otherwise the restoration will fail. If not specified,
170+
the "size_bytes" value returned from the CSI "ListSnapshots" gRPC
171+
call if the driver supports it. When restoring a volume from this
172+
snapshot, the size of the volume MUST NOT be smaller than the restoreSize
173+
if it is specified. Otherwise the restoration will fail. If not specified,
174174
it indicates that the size is unknown.
175175
format: int64
176176
minimum: 0

config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml

+10-11
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ spec:
2121
preserveUnknownFields: false
2222
validation:
2323
openAPIV3Schema:
24-
description: VolumeSnapshot is a user's request for taking a point-in-time snapshot
25-
of a PersistentVolumeClaim. Upon successful creation of a snapshot by the
26-
underlying storage system, it is bound to a corresponding VolumeSnapshotContent.
24+
description: VolumeSnapshot is a user's request for either creating a point-in-time
25+
snapshot of a persistent volume, or binding to a pre-existing snapshot.
2726
properties:
2827
apiVersion:
2928
description: 'APIVersion defines the versioned schema of this representation
@@ -89,10 +88,10 @@ spec:
8988
storage system. In dynamic snapshot creation case, it will be filled
9089
in upon snapshot creation with the "creation_time" field returned
9190
from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot,
92-
it will be set to the "size_byte" value returned from CSI "ListSnapshots"
93-
gRPC call if there exists a matching CSI driver that supports it after
94-
binding. If not specified, it indicates that the creation time of
95-
the snapshot is unknown.
91+
it will be set to the "size_bytes" value returned from the CSI "ListSnapshots"
92+
gRPC call if the driver exists and supports it after binding. If not
93+
specified, it indicates that the creation time of the snapshot is
94+
unknown.
9695
format: date-time
9796
type: string
9897
error:
@@ -118,10 +117,10 @@ spec:
118117
will be set to true after underlying storage system has successfully
119118
finished all out-of-bound procedures to make a snapshot ready to be
120119
used to restore a volume. For a pre-existing snapshot, readyToUse
121-
will be set to the "read_to_use" field returned from CSI "ListSnapshots"
122-
gRPC call if there exists a matching CSI driver that supports it after
123-
binding. Otherwise, this field will be set to "True". If not specified,
124-
it indicates that the readiness of a snapshot is unknown.
120+
will be set to the "ready_to_use" field returned from the CSI "ListSnapshots"
121+
gRPC call if the driver exists and supports it after binding. Otherwise,
122+
this field will be set to "True". If not specified, it indicates that
123+
the readiness of a snapshot is unknown.
125124
type: boolean
126125
restoreSize:
127126
description: restoreSize, if specified, represents the complete size

pkg/apis/volumesnapshot/v1beta1/types.go

+15-16
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ import (
2626
// +genclient
2727
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2828

29-
// VolumeSnapshot is a user's request for taking a point-in-time snapshot of a PersistentVolumeClaim.
30-
// Upon successful creation of a snapshot by the underlying storage system, it is bound to a
31-
// corresponding VolumeSnapshotContent.
29+
// VolumeSnapshot is a user's request for either creating a point-in-time
30+
// snapshot of a persistent volume, or binding to a pre-existing snapshot.
3231
// +kubebuilder:object:root=true
3332
// +kubebuilder:resource:scope=Namespaced
3433
// +kubebuilder:subresource:status
@@ -119,9 +118,9 @@ type VolumeSnapshotStatus struct {
119118
// snapshot was successfully cut on the underlying storage system.
120119
// In dynamic snapshot creation case, it will be filled in upon snapshot creation
121120
// with the "creation_time" field returned from CSI "CreateSnapshot" gRPC call.
122-
// For a pre-existing snapshot, it will be set to the "size_byte" value returned
123-
// from CSI "ListSnapshots" gRPC call if there exists a matching CSI driver that
124-
// supports it after binding.
121+
// For a pre-existing snapshot, it will be set to the "size_bytes" value returned
122+
// from the CSI "ListSnapshots" gRPC call if the driver exists and supports it
123+
// after binding.
125124
// If not specified, it indicates that the creation time of the snapshot is unknown.
126125
// +optional
127126
CreationTime *metav1.Time `json:"creationTime,omitempty" protobuf:"bytes,2,opt,name=creationTime"`
@@ -130,9 +129,9 @@ type VolumeSnapshotStatus struct {
130129
// In dynamic snapshot creation case, readyToUse will be set to true after underlying storage
131130
// system has successfully finished all out-of-bound procedures to make a snapshot ready to
132131
// be used to restore a volume.
133-
// For a pre-existing snapshot, readyToUse will be set to the "read_to_use" field
134-
// returned from CSI "ListSnapshots" gRPC call if there exists a matching CSI driver
135-
// that supports it after binding.
132+
// For a pre-existing snapshot, readyToUse will be set to the "ready_to_use" field
133+
// returned from the CSI "ListSnapshots" gRPC call if the driver exists and
134+
// supports it after binding.
136135
// Otherwise, this field will be set to "True".
137136
// If not specified, it indicates that the readiness of a snapshot is unknown.
138137
// +optional
@@ -295,14 +294,14 @@ type VolumeSnapshotContentSpec struct {
295294
// TODO(xiangqian): Add a webhook to ensure that VolumeSnapshotContentSource members
296295
// will be immutable once specified.
297296
type VolumeSnapshotContentSource struct {
298-
// volumeHandle specifies the CSI name of the volume from which a snapshot
297+
// volumeHandle specifies the "volume_id" of the volume from which a snapshot
299298
// should be dynamically taken from.
300299
// This field is immutable.
301300
// +optional
302301
VolumeHandle *string `json:"volumeHandle,omitempty" protobuf:"bytes,1,opt,name=volumeHandle"`
303302

304-
// snapshotHandle specifies the CSI name of a pre-existing snapshot on the
305-
// underlying storage system.
303+
// snapshotHandle specifies the "snapshot_id" of a pre-existing snapshot on
304+
// the underlying storage system.
306305
// This field is immutable.
307306
// +optional
308307
SnapshotHandle *string `json:"snapshotHandle,omitempty" protobuf:"bytes,2,opt,name=snapshotHandle"`
@@ -321,7 +320,7 @@ type VolumeSnapshotContentStatus struct {
321320
// In dynamic snapshot creation case, this field will be filled in with the
322321
// "creation_time" value returned from CSI "CreateSnapshotRequest" gRPC call.
323322
// For pre-existing snapshot, this field will be filled with the "creation_time"
324-
// value returned from CSI "ListSnapshots" gRPC call if the CSI driver supports.
323+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it.
325324
// The format of this field is a Unix nanoseconds time encoded as an int64.
326325
// On Unix, the command `date +%s%N` returns the current time in nanoseconds
327326
// since 1970-01-01 00:00:00 UTC.
@@ -332,7 +331,7 @@ type VolumeSnapshotContentStatus struct {
332331
// In dynamic snapshot creation case, this field will be filled in with the
333332
// "size_bytes" value returned from CSI "CreateSnapshotRequest" gRPC call.
334333
// For pre-existing snapshot, this field will be filled with the "size_bytes"
335-
// value returned from CSI "ListSnapshots" gRPC call if the CSI driver supports.
334+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it.
336335
// When restoring a volume from this snapshot, the size of the volume MUST NOT
337336
// be smaller than the restoreSize if it is specified.
338337
// Otherwise the restoration will fail.
@@ -344,8 +343,8 @@ type VolumeSnapshotContentStatus struct {
344343
// readyToUse indicates if a snapshot is ready to be used to restore a volume.
345344
// In dynamic snapshot creation case, this field will be filled in with the
346345
// "ready_to_use" value returned from CSI "CreateSnapshotRequest" gRPC call.
347-
// For pre-existing snapshot, this field will be filled with the "read_to_use"
348-
// value returned from CSI "ListSnapshots" gRPC call if the CSI driver supports.
346+
// For pre-existing snapshot, this field will be filled with the "ready_to_use"
347+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it.
349348
// If not specified, it means the readiness of a snapshot is unknown.
350349
// +optional.
351350
ReadyToUse *bool `json:"readyToUse,omitempty" protobuf:"varint,4,opt,name=readyToUse"`

0 commit comments

Comments
 (0)