cue.dev/x/crd/k8s.io/storage@v0.1.0

groupsnapshot/v1beta1/VolumeGroupSnapshot.cue raw

  1package v1beta1
  2
  3import "time"
  4
  5// VolumeGroupSnapshot is a user's request for creating either a
  6// point-in-time
  7// group snapshot or binding to a pre-existing group snapshot.
  8#VolumeGroupSnapshot: {
  9	_embeddedResource
 10
 11	// APIVersion defines the versioned schema of this representation
 12	// of an object.
 13	// Servers should convert recognized schemas to the latest
 14	// internal value, and
 15	// may reject unrecognized values.
 16	// More info:
 17	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 18	"apiVersion"?: string
 19
 20	// Kind is a string value representing the REST resource this
 21	// object represents.
 22	// Servers may infer this from the endpoint the client submits
 23	// requests to.
 24	// Cannot be updated.
 25	// In CamelCase.
 26	// More info:
 27	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 28	"kind"?: string
 29	"metadata"?: {}
 30
 31	// Spec defines the desired characteristics of a group snapshot
 32	// requested by a user.
 33	// Required.
 34	"spec"!: {
 35		// Source specifies where a group snapshot will be created from.
 36		// This field is immutable after creation.
 37		// Required.
 38		"source"!: {
 39			// Selector is a label query over persistent volume claims that
 40			// are to be
 41			// grouped together for snapshotting.
 42			// This labelSelector will be used to match the label added to a
 43			// PVC.
 44			// If the label is added or removed to a volume after a group
 45			// snapshot
 46			// is created, the existing group snapshots won't be modified.
 47			// Once a VolumeGroupSnapshotContent is created and the sidecar
 48			// starts to process
 49			// it, the volume list will not change with retries.
 50			"selector"?: {
 51				// matchExpressions is a list of label selector requirements. The
 52				// requirements are ANDed.
 53				"matchExpressions"?: [...{
 54					// key is the label key that the selector applies to.
 55					"key"!: string
 56
 57					// operator represents a key's relationship to a set of values.
 58					// Valid operators are In, NotIn, Exists and DoesNotExist.
 59					"operator"!: string
 60
 61					// values is an array of string values. If the operator is In or
 62					// NotIn,
 63					// the values array must be non-empty. If the operator is Exists
 64					// or DoesNotExist,
 65					// the values array must be empty. This array is replaced during a
 66					// strategic
 67					// merge patch.
 68					"values"?: [...string]
 69				}]
 70
 71				// matchLabels is a map of {key,value} pairs. A single {key,value}
 72				// in the matchLabels
 73				// map is equivalent to an element of matchExpressions, whose key
 74				// field is "key", the
 75				// operator is "In", and the values array contains only "value".
 76				// The requirements are ANDed.
 77				"matchLabels"?: {
 78					[string]: string
 79				}
 80			}
 81
 82			// VolumeGroupSnapshotContentName specifies the name of a
 83			// pre-existing VolumeGroupSnapshotContent
 84			// object representing an existing volume group snapshot.
 85			// This field should be set if the volume group snapshot already
 86			// exists and
 87			// only needs a representation in Kubernetes.
 88			// This field is immutable.
 89			"volumeGroupSnapshotContentName"?: string
 90		}
 91
 92		// VolumeGroupSnapshotClassName is the name of the
 93		// VolumeGroupSnapshotClass
 94		// requested by the VolumeGroupSnapshot.
 95		// VolumeGroupSnapshotClassName may be left nil to indicate that
 96		// the default
 97		// class will be used.
 98		// Empty string is not allowed for this field.
 99		"volumeGroupSnapshotClassName"?: string
100	}
101
102	// Status represents the current information of a group snapshot.
103	// Consumers must verify binding between VolumeGroupSnapshot and
104	// VolumeGroupSnapshotContent objects is successful (by validating
105	// that both
106	// VolumeGroupSnapshot and VolumeGroupSnapshotContent point to
107	// each other) before
108	// using this object.
109	"status"?: {
110		// BoundVolumeGroupSnapshotContentName is the name of the
111		// VolumeGroupSnapshotContent
112		// object to which this VolumeGroupSnapshot object intends to bind
113		// to.
114		// If not specified, it indicates that the VolumeGroupSnapshot
115		// object has not
116		// been successfully bound to a VolumeGroupSnapshotContent object
117		// yet.
118		// NOTE: To avoid possible security issues, consumers must verify
119		// binding between
120		// VolumeGroupSnapshot and VolumeGroupSnapshotContent objects is
121		// successful
122		// (by validating that both VolumeGroupSnapshot and
123		// VolumeGroupSnapshotContent
124		// point at each other) before using this object.
125		"boundVolumeGroupSnapshotContentName"?: string
126
127		// CreationTime is the timestamp when the point-in-time group
128		// snapshot is taken
129		// by the underlying storage system.
130		// If not specified, it may indicate that the creation time of the
131		// group snapshot
132		// is unknown.
133		// The format of this field is a Unix nanoseconds time encoded as
134		// an int64.
135		// On Unix, the command date +%s%N returns the current time in
136		// nanoseconds
137		// since 1970-01-01 00:00:00 UTC.
138		// This field is updated based on the CreationTime field in
139		// VolumeGroupSnapshotContentStatus
140		"creationTime"?: time.Time
141
142		// Error is the last observed error during group snapshot
143		// creation, if any.
144		// This field could be helpful to upper level controllers (i.e.,
145		// application
146		// controller) to decide whether they should continue on waiting
147		// for the group
148		// snapshot to be created based on the type of error reported.
149		// The snapshot controller will keep retrying when an error occurs
150		// during the
151		// group snapshot creation. Upon success, this error field will be
152		// cleared.
153		"error"?: {
154			// message is a string detailing the encountered error during
155			// snapshot
156			// creation if specified.
157			// NOTE: message may be logged, and it should not contain
158			// sensitive
159			// information.
160			"message"?: string
161
162			// time is the timestamp when the error was encountered.
163			"time"?: time.Time
164		}
165
166		// ReadyToUse indicates if all the individual snapshots in the
167		// group are ready
168		// to be used to restore a group of volumes.
169		// ReadyToUse becomes true when ReadyToUse of all individual
170		// snapshots become true.
171		// If not specified, it means the readiness of a group snapshot is
172		// unknown.
173		"readyToUse"?: bool
174	}
175
176	_embeddedResource: {
177		"apiVersion"!: string
178		"kind"!:       string
179		"metadata"?: {
180			...
181		}
182	}
183	apiVersion: "groupsnapshot.storage.k8s.io/v1beta1"
184	kind:       "VolumeGroupSnapshot"
185	metadata!: {
186		"name"!:      string
187		"namespace"!: string
188		"labels"?: {
189			[string]: string
190		}
191		"annotations"?: {
192			[string]: string
193		}
194		...
195	}
196}