@@ -26,9 +26,8 @@ import (
26
26
// +genclient
27
27
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
28
28
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.
32
31
// +kubebuilder:object:root=true
33
32
// +kubebuilder:resource:scope=Namespaced
34
33
// +kubebuilder:subresource:status
@@ -115,41 +114,34 @@ type VolumeSnapshotStatus struct {
115
114
// +optional
116
115
BoundVolumeSnapshotContentName * string `json:"boundVolumeSnapshotContentName,omitempty" protobuf:"bytes,1,opt,name=boundVolumeSnapshotContentName"`
117
116
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.
125
123
// If not specified, it indicates that the creation time of the snapshot is unknown.
126
124
// +optional
127
125
CreationTime * metav1.Time `json:"creationTime,omitempty" protobuf:"bytes,2,opt,name=creationTime"`
128
126
129
127
// 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.
138
134
// +optional
139
135
ReadyToUse * bool `json:"readyToUse,omitempty" protobuf:"varint,3,opt,name=readyToUse"`
140
136
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.
153
145
// +optional
154
146
RestoreSize * resource.Quantity `json:"restoreSize,omitempty" protobuf:"bytes,4,opt,name=restoreSize"`
155
147
@@ -279,9 +271,9 @@ type VolumeSnapshotContentSpec struct {
279
271
// Required.
280
272
Driver string `json:"driver" protobuf:"bytes,3,opt,name=driver"`
281
273
282
- // name of the SnapshotClass to which this snapshot belongs.
274
+ // name of the VolumeSnapshotClass to which this snapshot belongs.
283
275
// +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 "`
285
277
286
278
// source specifies from where a snapshot will be created.
287
279
// This field is immutable after creation.
@@ -295,14 +287,14 @@ type VolumeSnapshotContentSpec struct {
295
287
// TODO(xiangqian): Add a webhook to ensure that VolumeSnapshotContentSource members
296
288
// will be immutable once specified.
297
289
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
299
291
// should be dynamically taken from.
300
292
// This field is immutable.
301
293
// +optional
302
294
VolumeHandle * string `json:"volumeHandle,omitempty" protobuf:"bytes,1,opt,name=volumeHandle"`
303
295
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.
306
298
// This field is immutable.
307
299
// +optional
308
300
SnapshotHandle * string `json:"snapshotHandle,omitempty" protobuf:"bytes,2,opt,name=snapshotHandle"`
@@ -320,8 +312,9 @@ type VolumeSnapshotContentStatus struct {
320
312
// by the underlying storage system.
321
313
// In dynamic snapshot creation case, this field will be filled in with the
322
314
// "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.
325
318
// The format of this field is a Unix nanoseconds time encoded as an int64.
326
319
// On Unix, the command `date +%s%N` returns the current time in nanoseconds
327
320
// since 1970-01-01 00:00:00 UTC.
@@ -331,11 +324,10 @@ type VolumeSnapshotContentStatus struct {
331
324
// restoreSize represents the complete size of the snapshot in bytes.
332
325
// In dynamic snapshot creation case, this field will be filled in with the
333
326
// "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 .
336
329
// 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.
339
331
// If not specified, it indicates that the size is unknown.
340
332
// +kubebuilder:validation:Minimum=0
341
333
// +optional
@@ -344,8 +336,9 @@ type VolumeSnapshotContentStatus struct {
344
336
// readyToUse indicates if a snapshot is ready to be used to restore a volume.
345
337
// In dynamic snapshot creation case, this field will be filled in with the
346
338
// "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".
349
342
// If not specified, it means the readiness of a snapshot is unknown.
350
343
// +optional.
351
344
ReadyToUse * bool `json:"readyToUse,omitempty" protobuf:"varint,4,opt,name=readyToUse"`
0 commit comments