Skip to content

Commit

Permalink
Update CRDs for beta
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <[email protected]>
  • Loading branch information
ggriffiths committed Oct 22, 2019
1 parent 544ec55 commit 579ea03
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 114 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
Expand All @@ -9,7 +8,9 @@ spec:
group: snapshot.storage.k8s.io
names:
kind: VolumeSnapshotClass
listKind: VolumeSnapshotClassList
plural: volumesnapshotclasses
singular: volumesnapshotclass
scope: Cluster
validation:
openAPIV3Schema:
Expand All @@ -24,19 +25,23 @@ spec:
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
deletionPolicy:
allOf:
- enum:
- Delete
- Retain
- enum:
- Delete
- Retain
description: deletionPolicy determines whether a VolumeSnapshotContent created
through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot
is deleted. Supported values are "Retain" and "Delete". "Retain" means
that the VolumeSnapshotContent and its physical snapshot on underlying
storage system are kept. "Delete" means that the VolumeSnapshotContent
and its physical snapshot on underlying storage system are deleted. If
not specified, the default value is "Delete"
enum:
- Delete
- Retain
and its physical snapshot on underlying storage system are deleted. Required.
type: string
driver:
description: driver is the name of the driver that handles this VolumeSnapshotClass.
description: driver is the name of the storage driver that handles this
VolumeSnapshotClass. Required.
type: string
kind:
description: 'Kind is a string value representing the REST resource this
Expand All @@ -53,6 +58,7 @@ spec:
parameters for creating snapshots. These values are opaque to Kubernetes.
type: object
required:
- deletionPolicy
- driver
type: object
version: v1beta1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
Expand All @@ -9,8 +8,12 @@ spec:
group: snapshot.storage.k8s.io
names:
kind: VolumeSnapshotContent
listKind: VolumeSnapshotContentList
plural: volumesnapshotcontents
singular: volumesnapshotcontent
scope: Cluster
subresources:
status: {}
validation:
openAPIV3Schema:
description: VolumeSnapshotContent represents the actual "on-disk" snapshot
Expand All @@ -31,63 +34,59 @@ spec:
type: object
spec:
description: spec defines properties of a VolumeSnapshotContent created
by underlying storage system.
by the underlying storage system. Required.
properties:
csi:
description: csi represents a volume snapshot created by a CSI(Container
Storage Interface) driver.
properties:
creationTime:
description: creationTime is the timestamp when the point-in-time
snapshot is taken by the underlying storage system. This timestamp
is returned by the CSI driver after the snapshot is cut. The format
of this field is a Unix nanoseconds time encoded as an int64.
On Unix, the command `date +%s%N` returns the current time in
nanoseconds (aka, epoch time) since 1970-01-01 00:00:00 UTC.
format: int64
type: integer
driver:
description: driver is the name of the CSI driver used to create
the physical snapshot on the underlying storage system. This MUST
be the same name returned by the CSI GetPluginName() call for
that driver. Required.
type: string
restoreSize:
description: restoreSize specifies the number of bytes that the
snapshot's data would consume when restored to a volume. When
restoring a volume from a snapshot, the volume size needs to be
equal to or larger than the RestoreSize if it is specified.
format: int64
type: integer
snapshotHandle:
description: snapshotHandle is the snapshot id returned by the CSI
driver in the CreateSnapshotResponse and is used as the snapshot
identifier for all subsequent CSI calls. Required.
type: string
required:
- driver
- snapshotHandle
type: object
deletionPolicy:
allOf:
- enum:
- Delete
- Retain
- enum:
- Delete
- Retain
description: deletionPolicy determines whether this VolumeSnapshotContent
and its bound physical snapshot on the underlying storage system should
be deleted when its VolumeSnapshot is deleted. Supported values are
"Retain" and "Delete". "Retain" means that the VolumeSnapshotContent
and its physical snapshot on the underlying storage system should
be deleted when its bound VolumeSnapshot is deleted. Supported values
are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent
and its physical snapshot on underlying storage system are kept. "Delete"
means that the VolumeSnapshotContent and its physical snapshot on
underlying storage system are deleted. If not specified, the default
value is "Retain"
enum:
- Delete
- Retain
underlying storage system are deleted. In dynamic snapshot creation
case, this field will be filled in with the "DeletionPolicy" field
defined in the VolumeSnapshotClass the VolumeSnapshot refers to. For
pre-existing snapshots, users MUST specify this field when creating
the VolumeSnapshotContent object. Required.
type: string
driver:
description: driver is the name of the CSI driver used to create the
physical snapshot on the underlying storage system. This MUST be the
same as the name returned by the CSI GetPluginName() call for that
driver. Required.
type: string
snapshotClassName:
description: name of the SnapshotClass to which this snapshot belongs.
type: string
source:
description: source specifies from where a snapshot will be created.
This field is immutable after creation. Required.
properties:
snapshotHandle:
description: snapshotHandle specifies the CSI name of a pre-existing
snapshot on the underlying storage system. This field is immutable
once specified.
type: string
volumeHandle:
description: volumeHandle specifies the CSI name of the volume from
which a snapshot should be dynamically taken from. This field
is immutable once specified.
type: string
type: object
volumeSnapshotRef:
description: volumeSnapshotRef specifies the VolumeSnapshot object that
this VolumeSnapshotContent is bound with. The VolumeSnapshot.Spec.VolumeSnapshotContentName
field must reference this VolumeSnapshotContent name for the binding
to be considered valid(a.k.a bi-directional binding). If the referenced
VolumeSnapshot object does not exist(i.e., deleted by user), then
the VolumeSnapshotContent.Spec.DeletionPolicy is triggered.
description: volumeSnapshotRef specifies the VolumeSnapshot object to
which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName
field must reference to this VolumeSnapshotContent's name for the
bidirectional binding to be valid. For a pre-existing VolumeSnapshotContent
object, name and namespace of the VolumeSnapshot object MUST be provided
for binding to happen. This field is immutable after creation. Required.
properties:
apiVersion:
description: API version of the referent.
Expand Down Expand Up @@ -122,6 +121,61 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
required:
- deletionPolicy
- driver
- source
- volumeSnapshotRef
type: object
status:
description: status represents the current information of a snapshot.
properties:
creationTime:
description: creationTime is the timestamp when the point-in-time snapshot
is taken by the underlying storage system. This timestamp is returned
by the CSI driver after the snapshot is cut. The format of this field
is a Unix nanoseconds 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.
format: int64
type: integer
error:
description: error is the latest observed error during snapshot creation,
if any.
properties:
message:
description: 'message is a string detailing the encountered error
during snapshot creation if specified. NOTE: message may be logged,
and it should not contain sensitive information.'
type: string
time:
description: time is the timestamp when the error was encountered.
format: date-time
type: string
type: object
readyToUse:
description: readyToUse indicates if a snapshot is ready to be used
to restore a volume. In dynamic snapshot creation case, this field
will be filled in with the value returned from CSI "CreateSnapshotRequest"
gRPC call. For pre-existing snapshot, this field will be updated with
the value returned from CSI "ListSnapshots" gRPC call if the corresponding
driver supports. If not specified, it means the readiness of a snapshot
is unknown.
type: boolean
restoreSize:
description: restoreSize represents the complete size of the snapshot
in bytes. When restoring a volume from this snapshot, the size of
the volume MUST NOT be smaller than the restoreSize if it is specified.
Otherwise the restoration will fail. If not specified, it indicates
that the size is unknown.
format: int64
minimum: 0
type: integer
snapshotHandle:
description: snapshotHandle is the CSI name of a snapshot on the underlying
storage system. If not specified, it indicates that dynamic snapshot
creation has either failed or it is still in progress.
type: string
type: object
required:
- spec
Expand Down
Loading

0 comments on commit 579ea03

Please sign in to comment.