Skip to content

Commit be76d8c

Browse files
committed
more comment updates
VolumeSnapshot comments rename to VolumeSnapshotClassName adding license fix comments
1 parent ba6ec14 commit be76d8c

6 files changed

+93
-103
lines changed

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

+24-21
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,24 @@ spec:
6060
same as the name returned by the CSI GetPluginName() call for that
6161
driver. Required.
6262
type: string
63-
snapshotClassName:
64-
description: name of the SnapshotClass to which this snapshot belongs.
65-
type: string
6663
source:
6764
description: source specifies from where a snapshot will be created.
6865
This field is immutable after creation. Required.
6966
properties:
7067
snapshotHandle:
71-
description: snapshotHandle specifies the CSI name of a pre-existing
68+
description: snapshotHandle specifies the "snapshot_id" of a pre-existing
7269
snapshot on the underlying storage system. This field is immutable.
7370
type: string
7471
volumeHandle:
75-
description: volumeHandle specifies the CSI name of the volume from
76-
which a snapshot should be dynamically taken from. This field
72+
description: volumeHandle specifies the "volume_id" of the volume
73+
from which a snapshot should be dynamically taken from. This field
7774
is immutable.
7875
type: string
7976
type: object
77+
volumeSnapshotClassName:
78+
description: name of the VolumeSnapshotClass to which this snapshot
79+
belongs.
80+
type: string
8081
volumeSnapshotRef:
8182
description: volumeSnapshotRef specifies the VolumeSnapshot object to
8283
which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName
@@ -131,12 +132,13 @@ spec:
131132
description: creationTime is the timestamp when the point-in-time snapshot
132133
is taken by the underlying storage system. In dynamic snapshot creation
133134
case, this field will be filled in with the "creation_time" value
134-
returned from CSI "CreateSnapshotRequest" gRPC call. For pre-existing
135+
returned from CSI "CreateSnapshotRequest" gRPC call. For a pre-existing
135136
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
139-
in nanoseconds since 1970-01-01 00:00:00 UTC.
137+
returned from the CSI "ListSnapshots" gRPC call if the driver supports
138+
it. If not specified, it indicates the creation time is unknown. The
139+
format of this field is a Unix nanoseconds time encoded as an int64.
140+
On Unix, the command `date +%s%N` returns the current time in nanoseconds
141+
since 1970-01-01 00:00:00 UTC.
140142
format: int64
141143
type: integer
142144
error:
@@ -157,21 +159,22 @@ spec:
157159
description: readyToUse indicates if a snapshot is ready to be used
158160
to restore a volume. In dynamic snapshot creation case, this field
159161
will be filled in with the "ready_to_use" value returned from CSI
160-
"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,
163-
it means the readiness of a snapshot is unknown.
162+
"CreateSnapshotRequest" gRPC call. For a pre-existing snapshot, this
163+
field will be filled with the "ready_to_use" value returned from the
164+
CSI "ListSnapshots" gRPC call if the driver supports it, otherwise,
165+
this field will be set to "True". If not specified, it means the readiness
166+
of a snapshot is unknown.
164167
type: boolean
165168
restoreSize:
166169
description: restoreSize represents the complete size of the snapshot
167170
in bytes. In dynamic snapshot creation case, this field will be filled
168171
in with the "size_bytes" value returned from CSI "CreateSnapshotRequest"
169-
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,
174-
it indicates that the size is unknown.
172+
gRPC call. For a pre-existing snapshot, this field will be filled
173+
with the "size_bytes" value returned from the CSI "ListSnapshots"
174+
gRPC call if the driver supports it. When restoring a volume from
175+
this snapshot, the size of the volume MUST NOT be smaller than the
176+
restoreSize if it is specified, otherwise the restoration will fail.
177+
If not specified, it indicates that the size is unknown.
175178
format: int64
176179
minimum: 0
177180
type: integer

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

+26-32
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
@@ -84,15 +83,14 @@ spec:
8483
avoid possible security issues.'
8584
type: string
8685
creationTime:
87-
description: creationTime, if specified, represents the timestamp when
88-
the point-in-time snapshot was successfully cut on the underlying
89-
storage system. In dynamic snapshot creation case, it will be filled
90-
in upon snapshot creation with the "creation_time" field returned
91-
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.
86+
description: creationTime is the timestamp when the point-in-time snapshot
87+
is taken by the underlying storage system. In dynamic snapshot creation
88+
case, this field will be filled in with the "creation_time" value
89+
returned from CSI "CreateSnapshotRequest" gRPC call. For a pre-existing
90+
snapshot, this field will be filled with the "creation_time" value
91+
returned from the CSI "ListSnapshots" gRPC call if the driver supports
92+
it. If not specified, it indicates that the creation time of the snapshot
93+
is unknown.
9694
format: date-time
9795
type: string
9896
error:
@@ -114,28 +112,24 @@ spec:
114112
type: object
115113
readyToUse:
116114
description: readyToUse indicates if a snapshot is ready to be used
117-
to restore a volume. In dynamic snapshot creation case, readyToUse
118-
will be set to true after underlying storage system has successfully
119-
finished all out-of-bound procedures to make a snapshot ready to be
120-
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.
115+
to restore a volume. In dynamic snapshot creation case, this field
116+
will be filled in with the "ready_to_use" value returned from CSI
117+
"CreateSnapshotRequest" gRPC call. For a pre-existing snapshot, this
118+
field will be filled with the "ready_to_use" value returned from the
119+
CSI "ListSnapshots" gRPC call if the driver supports it, otherwise,
120+
this field will be set to "True". If not specified, it means the readiness
121+
of a snapshot is unknown.
125122
type: boolean
126123
restoreSize:
127-
description: restoreSize, if specified, represents the complete size
128-
of the snapshot in bytes. In dynamic snapshot creation case, restoreSize
129-
will be filled with the "size_bytes" value returned from "CreateSnapshot"
130-
gRPC call. For a pre-existing snapshot, restoreSize will be filled
131-
with the "size_bytes" value returned from CSI "ListSnapshots" gRPC
132-
call if there exists a matching CSI driver that supports it after
133-
binding. The purpose of this field is to give user guidance on how
134-
much space is needed to restore a volume from this snapshot. When
135-
restoring a volume from a snapshot, the size of the volume MUST NOT
136-
be less than the restoreSize. Otherwise the restoration will fail.
137-
If not specified, it indicates that underlying storage system does
138-
not have the information available.
124+
description: restoreSize represents the complete size of the snapshot
125+
in bytes. In dynamic snapshot creation case, this field will be filled
126+
in with the "size_bytes" value returned from CSI "CreateSnapshotRequest"
127+
gRPC call. For a pre-existing snapshot, this field will be filled
128+
with the "size_bytes" value returned from the CSI "ListSnapshots"
129+
gRPC call if the driver supports it. When restoring a volume from
130+
this snapshot, the size of the volume MUST NOT be smaller than the
131+
restoreSize if it is specified, otherwise the restoration will fail.
132+
If not specified, it indicates that the size is unknown.
139133
type: string
140134
type: object
141135
required:

pkg/apis/volumesnapshot/v1beta1/types.go

+36-43
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
@@ -115,41 +114,34 @@ type VolumeSnapshotStatus struct {
115114
// +optional
116115
BoundVolumeSnapshotContentName *string `json:"boundVolumeSnapshotContentName,omitempty" protobuf:"bytes,1,opt,name=boundVolumeSnapshotContentName"`
117116

118-
// creationTime, if specified, represents the timestamp when the point-in-time
119-
// snapshot was successfully cut on the underlying storage system.
120-
// In dynamic snapshot creation case, it will be filled in upon snapshot creation
121-
// 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.
117+
// creationTime is the timestamp when the point-in-time snapshot is taken
118+
// by the underlying storage system.
119+
// In dynamic snapshot creation case, this field will be filled in with the
120+
// "creation_time" value returned from CSI "CreateSnapshotRequest" gRPC call.
121+
// For a pre-existing snapshot, this field will be filled with the "creation_time"
122+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it.
125123
// If not specified, it indicates that the creation time of the snapshot is unknown.
126124
// +optional
127125
CreationTime *metav1.Time `json:"creationTime,omitempty" protobuf:"bytes,2,opt,name=creationTime"`
128126

129127
// readyToUse indicates if a snapshot is ready to be used to restore a volume.
130-
// In dynamic snapshot creation case, readyToUse will be set to true after underlying storage
131-
// system has successfully finished all out-of-bound procedures to make a snapshot ready to
132-
// 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.
136-
// Otherwise, this field will be set to "True".
137-
// If not specified, it indicates that the readiness of a snapshot is unknown.
128+
// In dynamic snapshot creation case, this field will be filled in with the
129+
// "ready_to_use" value returned from CSI "CreateSnapshotRequest" gRPC call.
130+
// For a pre-existing snapshot, this field will be filled with the "ready_to_use"
131+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it,
132+
// otherwise, this field will be set to "True".
133+
// If not specified, it means the readiness of a snapshot is unknown.
138134
// +optional
139135
ReadyToUse *bool `json:"readyToUse,omitempty" protobuf:"varint,3,opt,name=readyToUse"`
140136

141-
// restoreSize, if specified, represents the complete size of the snapshot in bytes.
142-
// In dynamic snapshot creation case, restoreSize will be filled with the
143-
// "size_bytes" value returned from "CreateSnapshot" gRPC call.
144-
// For a pre-existing snapshot, restoreSize will be filled with the "size_bytes"
145-
// value returned from CSI "ListSnapshots" gRPC call if there exists a matching
146-
// CSI driver that supports it after binding.
147-
// The purpose of this field is to give user guidance on how much space is
148-
// needed to restore a volume from this snapshot.
149-
// When restoring a volume from a snapshot, the size of the volume MUST NOT
150-
// be less than the restoreSize. Otherwise the restoration will fail.
151-
// If not specified, it indicates that underlying storage system does not have
152-
// the information available.
137+
// restoreSize represents the complete size of the snapshot in bytes.
138+
// In dynamic snapshot creation case, this field will be filled in with the
139+
// "size_bytes" value returned from CSI "CreateSnapshotRequest" gRPC call.
140+
// For a pre-existing snapshot, this field will be filled with the "size_bytes"
141+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it.
142+
// When restoring a volume from this snapshot, the size of the volume MUST NOT
143+
// be smaller than the restoreSize if it is specified, otherwise the restoration will fail.
144+
// If not specified, it indicates that the size is unknown.
153145
// +optional
154146
RestoreSize *resource.Quantity `json:"restoreSize,omitempty" protobuf:"bytes,4,opt,name=restoreSize"`
155147

@@ -279,9 +271,9 @@ type VolumeSnapshotContentSpec struct {
279271
// Required.
280272
Driver string `json:"driver" protobuf:"bytes,3,opt,name=driver"`
281273

282-
// name of the SnapshotClass to which this snapshot belongs.
274+
// name of the VolumeSnapshotClass to which this snapshot belongs.
283275
// +optional
284-
SnapshotClassName *string `json:"snapshotClassName,omitempty" protobuf:"bytes,4,opt,name=snapshotClassName"`
276+
VolumeSnapshotClassName *string `json:"volumeSnapshotClassName,omitempty" protobuf:"bytes,4,opt,name=volumeSnapshotClassName"`
285277

286278
// source specifies from where a snapshot will be created.
287279
// This field is immutable after creation.
@@ -295,14 +287,14 @@ type VolumeSnapshotContentSpec struct {
295287
// TODO(xiangqian): Add a webhook to ensure that VolumeSnapshotContentSource members
296288
// will be immutable once specified.
297289
type VolumeSnapshotContentSource struct {
298-
// volumeHandle specifies the CSI name of the volume from which a snapshot
290+
// volumeHandle specifies the "volume_id" of the volume from which a snapshot
299291
// should be dynamically taken from.
300292
// This field is immutable.
301293
// +optional
302294
VolumeHandle *string `json:"volumeHandle,omitempty" protobuf:"bytes,1,opt,name=volumeHandle"`
303295

304-
// snapshotHandle specifies the CSI name of a pre-existing snapshot on the
305-
// underlying storage system.
296+
// snapshotHandle specifies the "snapshot_id" of a pre-existing snapshot on
297+
// the underlying storage system.
306298
// This field is immutable.
307299
// +optional
308300
SnapshotHandle *string `json:"snapshotHandle,omitempty" protobuf:"bytes,2,opt,name=snapshotHandle"`
@@ -320,8 +312,9 @@ type VolumeSnapshotContentStatus struct {
320312
// by the underlying storage system.
321313
// In dynamic snapshot creation case, this field will be filled in with the
322314
// "creation_time" value returned from CSI "CreateSnapshotRequest" gRPC call.
323-
// 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.
315+
// For a pre-existing snapshot, this field will be filled with the "creation_time"
316+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it.
317+
// If not specified, it indicates the creation time is unknown.
325318
// The format of this field is a Unix nanoseconds time encoded as an int64.
326319
// On Unix, the command `date +%s%N` returns the current time in nanoseconds
327320
// since 1970-01-01 00:00:00 UTC.
@@ -331,11 +324,10 @@ type VolumeSnapshotContentStatus struct {
331324
// restoreSize represents the complete size of the snapshot in bytes.
332325
// In dynamic snapshot creation case, this field will be filled in with the
333326
// "size_bytes" value returned from CSI "CreateSnapshotRequest" gRPC call.
334-
// 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.
327+
// For a pre-existing snapshot, this field will be filled with the "size_bytes"
328+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it.
336329
// When restoring a volume from this snapshot, the size of the volume MUST NOT
337-
// be smaller than the restoreSize if it is specified.
338-
// Otherwise the restoration will fail.
330+
// be smaller than the restoreSize if it is specified, otherwise the restoration will fail.
339331
// If not specified, it indicates that the size is unknown.
340332
// +kubebuilder:validation:Minimum=0
341333
// +optional
@@ -344,8 +336,9 @@ type VolumeSnapshotContentStatus struct {
344336
// readyToUse indicates if a snapshot is ready to be used to restore a volume.
345337
// In dynamic snapshot creation case, this field will be filled in with the
346338
// "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.
339+
// For a pre-existing snapshot, this field will be filled with the "ready_to_use"
340+
// value returned from the CSI "ListSnapshots" gRPC call if the driver supports it,
341+
// otherwise, this field will be set to "True".
349342
// If not specified, it means the readiness of a snapshot is unknown.
350343
// +optional.
351344
ReadyToUse *bool `json:"readyToUse,omitempty" protobuf:"varint,4,opt,name=readyToUse"`

0 commit comments

Comments
 (0)