Skip to content

Commit

Permalink
final adjustment on types.go based on feedback
Browse files Browse the repository at this point in the history
feedback fixes
  • Loading branch information
yuxiangqian committed Aug 26, 2019
1 parent 9b86d7c commit 0db4142
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 136 deletions.
37 changes: 20 additions & 17 deletions config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,30 @@ spec:
scope: ""
validation:
openAPIV3Schema:
description: VolumeSnapshotClass describes the parameters for a class of storage
snapshotter for which VolumeSnapshot can be dynamically taken for a given
PersistentVolumeClaim VolumeSnapshotClasses are non-namespaced. The name of
a VolumeSnapshotClass object is significant, it serves as the unique identifier
for a user to request a snapshot to be created using the specific VolumeSnapshotClass
description: VolumeSnapshotClass specifies parameters that a underlying storage
system uses when creating a volume snapshot. A specific VolumeSnapshotClass
is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses
are non-namespaced
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
deletionPolicy:
description: DeletionPolicy defines whether a VolumeSnapshotContent and
its associated physical snapshot on underlying storage system should be
deleted or not when released from its corresponding VolumeSnapshot. If
not specified, the default will be VolumeSnapshotContentRetain for static
binding, and VolumeSnapshotContentDelete for dynamic snapshot creation.
description: DeletionPolicy determines whether a VolumeSnapshotContent created
through the VolumeSnapshotClass should be deleted when it's associated
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
type: string
driver:
description: Driver is the name of the driver that handles this VolumeSnapshotClass.
type: string
kind:
description: 'Kind is a string value representing the REST resource this
Expand All @@ -42,15 +49,11 @@ spec:
parameters:
additionalProperties:
type: string
description: Parameters holds parameters for underlying storage system.
These values are opaque to Kubernetes.
description: Parameters is a key-value map with storage driver specific
parameters for creating snapshots. These values are opaque to Kubernetes.
type: object
snapshotter:
description: Snapshotter is the name of the driver expected to handle VolumeSnapshot
requests of this VolumeSnapshotClass.
type: string
required:
- snapshotter
- driver
type: object
version: v1beta1
versions:
Expand Down
102 changes: 34 additions & 68 deletions config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ spec:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata'
type: object
spec:
description: Spec represents the desired state of the snapshot content
description: Spec defines a specification of a VolumeSnapshotContent created
by underlying storage system.
properties:
csiVolumeSnapshotSource:
description: CSI (Container Storage Interface) represents storage that
handled by an external CSI Volume Driver (Alpha feature).
description: CSIVolumeSnapshotSource represents a volume snapshot created
by a CSI(Container Storage Interface) driver..
properties:
creationTime:
description: Timestamp when the point-in-time snapshot is taken
Expand All @@ -43,87 +44,52 @@ spec:
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. This field is required in the CSI spec however made optional
here to support static binding.
UTC.
format: int64
type: integer
driver:
description: Driver is the name of the driver used to create a physical
snapshot on underlying storage system. This MUST be the same name
returned by the CSI GetPluginName() call for that driver. Required.
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: When restoring a volume from a snapshot, the volume
size needs to be equal to or larger than the RestoreSize if it
is specified. If RestoreSize is set to nil, in the dynamic snapshot
creation case, it means that the underlying storage system does
not have this information available; in the static binding case,
this piece of information is not available.
description: RestoreSize specifies the number of bytes that the
snapshot's data would consumer when gets restored to a volume.
This field is optional. 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 unique id returned from the underlying
storage system by the CSI driver's CreationSnapshot gRPC call.
It serves as the only and sufficient handle when communicating
with underlying storage systems via CSI driver for all subsequent
calls on the specific VolumeSnapshot Required.
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:
description: DeletionPolicy defines whether a VolumeSnapshotContent
and its associated physical snapshot on underlying storage system
should be deleted or not when released from its corresponding VolumeSnapshot.
If not specified, the default will be VolumeSnapshotContentRetain
for static binding, and VolumeSnapshotContentDelete for dynamic snapshot
creation.
description: DeletionPolicy determines whether this VolumeSnapshotContent
and it's associated 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 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
type: string
persistentVolumeRef:
description: PersistentVolumeRef represents the PersistentVolume that
the snapshot has been taken from. In dynamic snapshot creation case,
the field will be specified when VolumeSnapshot and VolumeSnapshotContent
are bound.
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of an
entire object, this string should contain a valid JSON/Go field
access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen only
to have some well-defined way of referencing a part of an object.
TODO: this design is not final and this field is subject to change
in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference is
made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
volumeSnapshotRef:
description: VolumeSnapshotRef is part of bi-directional binding between
VolumeSnapshot and VolumeSnapshotContent. Expect to be non-nil when
bound. VolumeSnapshot.VolumeSnapshotContentName is the authoritative
bind between VolumeSnapshot and VolumeSnapshotContent
description: VolumeSnapshotRef specifies the VolumeSnapshot object that
this VolumeSnapshotContent is associated with. The VolumeSnapshot.Spec.VolumeSnapshotContentName
field must reference this VolumeSnapshotContent name for the association
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.
properties:
apiVersion:
description: API version of the referent.
Expand Down
22 changes: 12 additions & 10 deletions config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ spec:
scope: ""
validation:
openAPIV3Schema:
description: VolumeSnapshot is a user's request for taking a point in time snapshot
of a volume. Upon successful creation of the snapshot by the volume provider,
it is bound to a corresponding VolumeSnapshotContent. VolumeSnapshot objects
are namespaced
description: VolumeSnapshot is a user's request for taking a point-in-time snapshot
of a PersistentVolumeClaim. Upon successful creation of the snapshot by the
volume provider, it is bound to a corresponding VolumeSnapshotContent. VolumeSnapshot
objects are namespaced
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down Expand Up @@ -78,9 +78,10 @@ spec:
rely on this piece of information programmatically.'
properties:
creationTime:
description: CreationTime, if not nil, represents the timestamp when
description: 'CreationTime, if not nil, represents the timestamp when
a snapshot was successfully cut by the underlying storage system.
In static binding, CreationTime might not be available.
In static binding, CreationTime might not be available. NOTE: Controllers
MUST NOT rely on this field programmatically'
format: date-time
type: string
error:
Expand All @@ -98,19 +99,20 @@ spec:
type: string
type: object
readyToUse:
description: ReadyToUse is a status/informational flag which provides
description: 'ReadyToUse is a status/informational flag which provides
transparency to users. In the dynamic snapshot creation case, ReadyToUse
will be set to true when underlying storage system has successfully
finished all procedures out-of-bound to make a snapshot available
AND snapshot controller has bound the VolumeSnapshot to a VolumeSnapshotContent
successfully.
successfully. NOTE: Controllers MUST NOT rely on this field programmatically'
type: boolean
restoreSize:
description: RestoreSize, if not nil, represents the minimum volume
description: 'RestoreSize, if not nil, represents the minimum volume
size to restore from a VolumeSnapshot It is a storage system level
property of a snapshot when the underlying storage system supports.
The field could be nil if the underlying storage system does not have
the information available, , or in cases like manual/static binding.
the information available, or in cases like manual/static binding.
NOTE: Controllers MUST NOT rely on this field programmatically'
type: string
required:
- readyToUse
Expand Down
Loading

0 comments on commit 0db4142

Please sign in to comment.