Skip to content

Commit 304f4bf

Browse files
authored
Merge pull request #865 from winrouter/master
Add more detail in vgs/vgsc/vgsclass printed columns
2 parents 5d5431f + 3cb5c30 commit 304f4bf

File tree

4 files changed

+103
-13
lines changed

4 files changed

+103
-13
lines changed

client/apis/volumegroupsnapshot/v1alpha1/types.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type VolumeGroupSnapshotStatus struct {
8888
CreationTime *metav1.Time `json:"creationTime,omitempty" protobuf:"bytes,2,opt,name=creationTime"`
8989

9090
// ReadyToUse indicates if all the individual snapshots in the group are ready
91-
// to be used to restore a volume.
91+
// to be used to restore a group of volumes.
9292
// ReadyToUse becomes true when ReadyToUse of all individual snapshots become true.
9393
// If not specified, it means the readiness of a group snapshot is unknown.
9494
// +optional
@@ -118,6 +118,11 @@ type VolumeGroupSnapshotStatus struct {
118118
// +kubebuilder:object:root=true
119119
// +kubebuilder:resource:scope=Namespaced,shortName=vgs
120120
// +kubebuilder:subresource:status
121+
// +kubebuilder:printcolumn:name="ReadyToUse",type=boolean,JSONPath=`.status.readyToUse`,description="Indicates if all the individual snapshots in the group are ready to be used to restore a group of volumes."
122+
// +kubebuilder:printcolumn:name="VolumeGroupSnapshotClass",type=string,JSONPath=`.spec.volumeGroupSnapshotClassName`,description="The name of the VolumeGroupSnapshotClass requested by the VolumeGroupSnapshot."
123+
// +kubebuilder:printcolumn:name="VolumeGroupSnapshotContent",type=string,JSONPath=`.status.boundVolumeGroupSnapshotContentName`,description="Name of the VolumeGroupSnapshotContent object to which the VolumeGroupSnapshot object intends to bind to. Please note that verification of binding actually requires checking both VolumeGroupSnapshot and VolumeGroupSnapshotContent to ensure both are pointing at each other. Binding MUST be verified prior to usage of this object."
124+
// +kubebuilder:printcolumn:name="CreationTime",type=date,JSONPath=`.status.creationTime`,description="Timestamp when the point-in-time group snapshot was taken by the underlying storage system."
125+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
121126
type VolumeGroupSnapshot struct {
122127
metav1.TypeMeta `json:",inline"`
123128
// Standard object's metadata.
@@ -157,6 +162,9 @@ type VolumeGroupSnapshotList struct {
157162
// VolumeGroupSnapshotClasses are non-namespaced.
158163
// +kubebuilder:object:root=true
159164
// +kubebuilder:resource:scope=Cluster,shortName=vgsclass;vgsclasses
165+
// +kubebuilder:printcolumn:name="Driver",type=string,JSONPath=`.driver`
166+
// +kubebuilder:printcolumn:name="DeletionPolicy",type=string,JSONPath=`.deletionPolicy`,description="Determines whether a VolumeGroupSnapshotContent created through the VolumeGroupSnapshotClass should be deleted when its bound VolumeGroupSnapshot is deleted."
167+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
160168
type VolumeGroupSnapshotClass struct {
161169
metav1.TypeMeta `json:",inline"`
162170
// Standard object's metadata.
@@ -210,6 +218,13 @@ type VolumeGroupSnapshotClassList struct {
210218
// +kubebuilder:object:root=true
211219
// +kubebuilder:resource:scope=Cluster,shortName=vgsc;vgscs
212220
// +kubebuilder:subresource:status
221+
// +kubebuilder:printcolumn:name="ReadyToUse",type=boolean,JSONPath=`.status.readyToUse`,description="Indicates if all the individual snapshots in the group are ready to be used to restore a group of volumes."
222+
// +kubebuilder:printcolumn:name="DeletionPolicy",type=string,JSONPath=`.spec.deletionPolicy`,description="Determines whether this VolumeGroupSnapshotContent and its physical group snapshot on the underlying storage system should be deleted when its bound VolumeGroupSnapshot is deleted."
223+
// +kubebuilder:printcolumn:name="Driver",type=string,JSONPath=`.spec.driver`,description="Name of the CSI driver used to create the physical group snapshot on the underlying storage system."
224+
// +kubebuilder:printcolumn:name="VolumeGroupSnapshotClass",type=string,JSONPath=`.spec.volumeGroupSnapshotClassName`,description="Name of the VolumeGroupSnapshotClass from which this group snapshot was (or will be) created."
225+
// +kubebuilder:printcolumn:name="VolumeGroupSnapshotNamespace",type=string,JSONPath=`.spec.volumeGroupSnapshotRef.namespace`,description="Namespace of the VolumeGroupSnapshot object to which this VolumeGroupSnapshotContent object is bound."
226+
// +kubebuilder:printcolumn:name="VolumeGroupSnapshot",type=string,JSONPath=`.spec.volumeGroupSnapshotRef.name`,description="Name of the VolumeGroupSnapshot object to which this VolumeGroupSnapshotContent object is bound."
227+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
213228
type VolumeGroupSnapshotContent struct {
214229
metav1.TypeMeta `json:",inline"`
215230
// Standard list metadata
@@ -312,7 +327,7 @@ type VolumeGroupSnapshotContentStatus struct {
312327
CreationTime *int64 `json:"creationTime,omitempty" protobuf:"varint,2,opt,name=creationTime"`
313328

314329
// ReadyToUse indicates if all the individual snapshots in the group are ready to be
315-
// used to restore a volume.
330+
// used to restore a group of volumes.
316331
// ReadyToUse becomes true when ReadyToUse of all individual snapshots become true.
317332
// +optional
318333
ReadyToUse *bool `json:"readyToUse,omitempty" protobuf:"varint,3,opt,name=readyToUse"`

client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ spec:
1919
singular: volumegroupsnapshotclass
2020
scope: Cluster
2121
versions:
22-
- name: v1alpha1
22+
- additionalPrinterColumns:
23+
- jsonPath: .driver
24+
name: Driver
25+
type: string
26+
- description: Determines whether a VolumeGroupSnapshotContent created through
27+
the VolumeGroupSnapshotClass should be deleted when its bound VolumeGroupSnapshot
28+
is deleted.
29+
jsonPath: .deletionPolicy
30+
name: DeletionPolicy
31+
type: string
32+
- jsonPath: .metadata.creationTimestamp
33+
name: Age
34+
type: date
35+
name: v1alpha1
2336
schema:
2437
openAPIV3Schema:
2538
description: VolumeGroupSnapshotClass specifies parameters that a underlying
@@ -66,3 +79,4 @@ spec:
6679
type: object
6780
served: true
6881
storage: true
82+
subresources: {}

client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,42 @@ spec:
1919
singular: volumegroupsnapshotcontent
2020
scope: Cluster
2121
versions:
22-
- name: v1alpha1
22+
- additionalPrinterColumns:
23+
- description: Indicates if all the individual snapshots in the group are ready
24+
to be used to restore a group of volumes.
25+
jsonPath: .status.readyToUse
26+
name: ReadyToUse
27+
type: boolean
28+
- description: Determines whether this VolumeGroupSnapshotContent and its physical
29+
group snapshot on the underlying storage system should be deleted when its
30+
bound VolumeGroupSnapshot is deleted.
31+
jsonPath: .spec.deletionPolicy
32+
name: DeletionPolicy
33+
type: string
34+
- description: Name of the CSI driver used to create the physical group snapshot
35+
on the underlying storage system.
36+
jsonPath: .spec.driver
37+
name: Driver
38+
type: string
39+
- description: Name of the VolumeGroupSnapshotClass from which this group snapshot
40+
was (or will be) created.
41+
jsonPath: .spec.volumeGroupSnapshotClassName
42+
name: VolumeGroupSnapshotClass
43+
type: string
44+
- description: Namespace of the VolumeGroupSnapshot object to which this VolumeGroupSnapshotContent
45+
object is bound.
46+
jsonPath: .spec.volumeGroupSnapshotRef.namespace
47+
name: VolumeGroupSnapshotNamespace
48+
type: string
49+
- description: Name of the VolumeGroupSnapshot object to which this VolumeGroupSnapshotContent
50+
object is bound.
51+
jsonPath: .spec.volumeGroupSnapshotRef.name
52+
name: VolumeGroupSnapshot
53+
type: string
54+
- jsonPath: .metadata.creationTimestamp
55+
name: Age
56+
type: date
57+
name: v1alpha1
2358
schema:
2459
openAPIV3Schema:
2560
description: VolumeGroupSnapshotContent represents the actual "on-disk" group
@@ -173,17 +208,17 @@ spec:
173208
type: object
174209
readyToUse:
175210
description: ReadyToUse indicates if all the individual snapshots
176-
in the group are ready to be used to restore a volume. ReadyToUse
177-
becomes true when ReadyToUse of all individual snapshots become
178-
true.
211+
in the group are ready to be used to restore a group of volumes.
212+
ReadyToUse becomes true when ReadyToUse of all individual snapshots
213+
become true.
179214
type: boolean
180215
volumeGroupSnapshotHandle:
181216
description: VolumeGroupSnapshotHandle is a unique id returned by
182217
the CSI driver to identify the VolumeGroupSnapshot on the storage
183218
system. If a storage system does not provide such an id, the CSI
184219
driver can choose to return the VolumeGroupSnapshot name.
185220
type: string
186-
volumeSnapshotRefList:
221+
volumeSnapshotContentRefList:
187222
description: VolumeSnapshotContentRefList is the list of volume snapshot
188223
content references for this group snapshot. The maximum number of
189224
allowed snapshots in the group is 100.

client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,33 @@ spec:
1818
singular: volumegroupsnapshot
1919
scope: Namespaced
2020
versions:
21-
- name: v1alpha1
21+
- additionalPrinterColumns:
22+
- description: Indicates if all the individual snapshots in the group are ready
23+
to be used to restore a group of volumes.
24+
jsonPath: .status.readyToUse
25+
name: ReadyToUse
26+
type: boolean
27+
- description: The name of the VolumeGroupSnapshotClass requested by the VolumeGroupSnapshot.
28+
jsonPath: .spec.volumeGroupSnapshotClassName
29+
name: VolumeGroupSnapshotClass
30+
type: string
31+
- description: Name of the VolumeGroupSnapshotContent object to which the VolumeGroupSnapshot
32+
object intends to bind to. Please note that verification of binding actually
33+
requires checking both VolumeGroupSnapshot and VolumeGroupSnapshotContent
34+
to ensure both are pointing at each other. Binding MUST be verified prior
35+
to usage of this object.
36+
jsonPath: .status.boundVolumeGroupSnapshotContentName
37+
name: VolumeGroupSnapshotContent
38+
type: string
39+
- description: Timestamp when the point-in-time group snapshot was taken by the
40+
underlying storage system.
41+
jsonPath: .status.creationTime
42+
name: CreationTime
43+
type: date
44+
- jsonPath: .metadata.creationTimestamp
45+
name: Age
46+
type: date
47+
name: v1alpha1
2248
schema:
2349
openAPIV3Schema:
2450
description: VolumeGroupSnapshot is a user's request for creating either a
@@ -160,10 +186,10 @@ spec:
160186
type: object
161187
readyToUse:
162188
description: ReadyToUse indicates if all the individual snapshots
163-
in the group are ready to be used to restore a volume. ReadyToUse
164-
becomes true when ReadyToUse of all individual snapshots become
165-
true. If not specified, it means the readiness of a group snapshot
166-
is unknown.
189+
in the group are ready to be used to restore a group of volumes.
190+
ReadyToUse becomes true when ReadyToUse of all individual snapshots
191+
become true. If not specified, it means the readiness of a group
192+
snapshot is unknown.
167193
type: boolean
168194
volumeSnapshotRefList:
169195
description: VolumeSnapshotRefList is the list of volume snapshot

0 commit comments

Comments
 (0)