Address review comments in the APIs.

This commit is contained in:
Xing Yang
2018-08-14 20:45:20 -07:00
parent 2c3b68f52b
commit 337564aeaa

View File

@@ -81,8 +81,9 @@ type VolumeSnapshotSpec struct {
// +optional // +optional
VolumeSnapshotClassName string `json:"snapshotClassName" protobuf:"bytes,3,opt,name=snapshotClassName"` VolumeSnapshotClassName string `json:"snapshotClassName" protobuf:"bytes,3,opt,name=snapshotClassName"`
// Size represents the size of the VolumeSnapshot // A description of the volume snapshot's resources and size.
Size core_v1.ResourceList // +optional
Size core_v1.ResourceList `json:"size,omitempty" protobuf:"bytes,4,rep,name=size,casttype=ResourceList,castkey=ResourceName"`
} }
// VolumeSnapshotStatus is the status of the VolumeSnapshot // VolumeSnapshotStatus is the status of the VolumeSnapshot
@@ -201,7 +202,7 @@ type VolumeSnapshotContentSpec struct {
// Name of the VolumeSnapshotClass used by the VolumeSnapshot. If not specified, a default snapshot class will // Name of the VolumeSnapshotClass used by the VolumeSnapshot. If not specified, a default snapshot class will
// be used if it is available. // be used if it is available.
// +optional // +optional
VolumeSnapshotClassName string `json:"snapshotClassName" protobuf:"bytes,3,opt,name=snapshotClassName"` VolumeSnapshotClassName string `json:"snapshotClassName" protobuf:"bytes,4,opt,name=snapshotClassName"`
} }
// VolumeSnapshotSource represents the actual location and type of the snapshot. Only one of its members may be specified. // VolumeSnapshotSource represents the actual location and type of the snapshot. Only one of its members may be specified.
@@ -214,22 +215,26 @@ type VolumeSnapshotSource struct {
// Represents the source from CSI volume snapshot // Represents the source from CSI volume snapshot
type CSIVolumeSnapshotSource struct { type CSIVolumeSnapshotSource struct {
// Driver is the name of the driver to use for this snapshot. // Driver is the name of the driver to use for this snapshot.
// This MUST be the same name returned by the CSI GetPluginName() call for
// that driver.
// Required. // Required.
Driver string `json:"driver"` Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"`
// SnapshotHandle is the unique snapshot id returned by the CSI volume // SnapshotHandle is the unique snapshot id returned by the CSI volume
// plugins CreateSnapshot to refer to the snapshot on all subsequent calls. // plugins CreateSnapshot to refer to the snapshot on all subsequent calls.
// Required. // Required.
SnapshotHandle string `json:"snapshotHandle"` SnapshotHandle string `json:"snapshotHandle" protobuf:"bytes,2,opt,name=snapshotHandle"`
// Timestamp when the point-in-time snapshot is taken on the storage // Timestamp when the point-in-time snapshot is taken on the storage
// system. This timestamp will be generated by the CSI volume driver after // system. This timestamp will be generated by the CSI volume driver after
// the snapshot is cut. The format of this field should be a Unix nanoseconds // the snapshot is cut. The format of this field should be a Unix nanoseconds
// time encoded as an int64. On Unix, the command `date +%s%N` returns // time encoded as an int64. On Unix, the command `date +%s%N` returns
// the current time in nanoseconds since 1970-01-01 00:00:00 UTC. // the current time in nanoseconds since 1970-01-01 00:00:00 UTC.
// This field is REQUIRED. // This field is required in the CSI spec but optional here to support static binding.
// +optional
CreatedAt int64 `json:"createdAt,omitempty" protobuf:"varint,3,opt,name=createdAt"` CreatedAt int64 `json:"createdAt,omitempty" protobuf:"varint,3,opt,name=createdAt"`
// Size represents the size of the VolumeSnapshot // A description of the volume snapshot's resources and size.
Size core_v1.ResourceList // +optional
Size core_v1.ResourceList `json:"size,omitempty" protobuf:"bytes,4,rep,name=size,casttype=ResourceList,castkey=ResourceName"`
} }