Skip to content

Commit 75d19c3

Browse files
add multiple label selector support to backup API
Signed-off-by: Shubham Pampattiwar <[email protected]> remove backup CLI bits Signed-off-by: Shubham Pampattiwar <[email protected]> labelselectors spec option for velero restore Signed-off-by: Shubham Pampattiwar <[email protected]> add changelog file Signed-off-by: Shubham Pampattiwar <[email protected]> update spec name to OrLabelSelectors Signed-off-by: Shubham Pampattiwar <[email protected]> minor fixes Signed-off-by: Shubham Pampattiwar <[email protected]> add validations for labelSelector and orLabelSelectors Signed-off-by: Shubham Pampattiwar <[email protected]> update crds.gp after fixing conflicts Signed-off-by: Shubham Pampattiwar <[email protected]>
1 parent aa71427 commit 75d19c3

File tree

12 files changed

+305
-42
lines changed

12 files changed

+305
-42
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add multiple label selector support to Velero Backup and Restore APIs

config/crd/v1/bases/velero.io_backups.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,60 @@ spec:
314314
type: string
315315
type: object
316316
type: object
317+
orLabelSelectors:
318+
description: OrLabelSelectors is list of metav1.LabelSelector to filter
319+
with when adding individual objects to the backup. If empty or nil,
320+
all objects are included. Optional. If multiple provided they will
321+
be joined by the OR operator
322+
items:
323+
description: A label selector is a label query over a set of resources.
324+
The result of matchLabels and matchExpressions are ANDed. An empty
325+
label selector matches all objects. A null label selector matches
326+
no objects.
327+
properties:
328+
matchExpressions:
329+
description: matchExpressions is a list of label selector requirements.
330+
The requirements are ANDed.
331+
items:
332+
description: A label selector requirement is a selector that
333+
contains values, a key, and an operator that relates the
334+
key and values.
335+
properties:
336+
key:
337+
description: key is the label key that the selector applies
338+
to.
339+
type: string
340+
operator:
341+
description: operator represents a key's relationship
342+
to a set of values. Valid operators are In, NotIn, Exists
343+
and DoesNotExist.
344+
type: string
345+
values:
346+
description: values is an array of string values. If the
347+
operator is In or NotIn, the values array must be non-empty.
348+
If the operator is Exists or DoesNotExist, the values
349+
array must be empty. This array is replaced during a
350+
strategic merge patch.
351+
items:
352+
type: string
353+
type: array
354+
required:
355+
- key
356+
- operator
357+
type: object
358+
type: array
359+
matchLabels:
360+
additionalProperties:
361+
type: string
362+
description: matchLabels is a map of {key,value} pairs. A single
363+
{key,value} in the matchLabels map is equivalent to an element
364+
of matchExpressions, whose key field is "key", the operator
365+
is "In", and the values array contains only "value". The requirements
366+
are ANDed.
367+
type: object
368+
type: object
369+
nullable: true
370+
type: array
317371
orderedResources:
318372
additionalProperties:
319373
type: string

config/crd/v1/bases/velero.io_restores.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,60 @@ spec:
17031703
included in the map will be restored into namespaces of the same
17041704
name.
17051705
type: object
1706+
orLabelSelectors:
1707+
description: OrLabelSelectors is list of metav1.LabelSelector to filter
1708+
with when restoring individual objects from the backup. If empty
1709+
or nil, all objects are included. Optional. If multiple provided
1710+
they will be joined by the OR operator
1711+
items:
1712+
description: A label selector is a label query over a set of resources.
1713+
The result of matchLabels and matchExpressions are ANDed. An empty
1714+
label selector matches all objects. A null label selector matches
1715+
no objects.
1716+
properties:
1717+
matchExpressions:
1718+
description: matchExpressions is a list of label selector requirements.
1719+
The requirements are ANDed.
1720+
items:
1721+
description: A label selector requirement is a selector that
1722+
contains values, a key, and an operator that relates the
1723+
key and values.
1724+
properties:
1725+
key:
1726+
description: key is the label key that the selector applies
1727+
to.
1728+
type: string
1729+
operator:
1730+
description: operator represents a key's relationship
1731+
to a set of values. Valid operators are In, NotIn, Exists
1732+
and DoesNotExist.
1733+
type: string
1734+
values:
1735+
description: values is an array of string values. If the
1736+
operator is In or NotIn, the values array must be non-empty.
1737+
If the operator is Exists or DoesNotExist, the values
1738+
array must be empty. This array is replaced during a
1739+
strategic merge patch.
1740+
items:
1741+
type: string
1742+
type: array
1743+
required:
1744+
- key
1745+
- operator
1746+
type: object
1747+
type: array
1748+
matchLabels:
1749+
additionalProperties:
1750+
type: string
1751+
description: matchLabels is a map of {key,value} pairs. A single
1752+
{key,value} in the matchLabels map is equivalent to an element
1753+
of matchExpressions, whose key field is "key", the operator
1754+
is "In", and the values array contains only "value". The requirements
1755+
are ANDed.
1756+
type: object
1757+
type: object
1758+
nullable: true
1759+
type: array
17061760
preserveNodePorts:
17071761
description: PreserveNodePorts specifies whether to restore old nodePorts
17081762
from backup.

config/crd/v1/bases/velero.io_schedules.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,60 @@ spec:
347347
type: string
348348
type: object
349349
type: object
350+
orLabelSelectors:
351+
description: OrLabelSelectors is list of metav1.LabelSelector
352+
to filter with when adding individual objects to the backup.
353+
If empty or nil, all objects are included. Optional. If multiple
354+
provided they will be joined by the OR operator
355+
items:
356+
description: A label selector is a label query over a set of
357+
resources. The result of matchLabels and matchExpressions
358+
are ANDed. An empty label selector matches all objects. A
359+
null label selector matches no objects.
360+
properties:
361+
matchExpressions:
362+
description: matchExpressions is a list of label selector
363+
requirements. The requirements are ANDed.
364+
items:
365+
description: A label selector requirement is a selector
366+
that contains values, a key, and an operator that relates
367+
the key and values.
368+
properties:
369+
key:
370+
description: key is the label key that the selector
371+
applies to.
372+
type: string
373+
operator:
374+
description: operator represents a key's relationship
375+
to a set of values. Valid operators are In, NotIn,
376+
Exists and DoesNotExist.
377+
type: string
378+
values:
379+
description: values is an array of string values.
380+
If the operator is In or NotIn, the values array
381+
must be non-empty. If the operator is Exists or
382+
DoesNotExist, the values array must be empty. This
383+
array is replaced during a strategic merge patch.
384+
items:
385+
type: string
386+
type: array
387+
required:
388+
- key
389+
- operator
390+
type: object
391+
type: array
392+
matchLabels:
393+
additionalProperties:
394+
type: string
395+
description: matchLabels is a map of {key,value} pairs.
396+
A single {key,value} in the matchLabels map is equivalent
397+
to an element of matchExpressions, whose key field is
398+
"key", the operator is "In", and the values array contains
399+
only "value". The requirements are ANDed.
400+
type: object
401+
type: object
402+
nullable: true
403+
type: array
350404
orderedResources:
351405
additionalProperties:
352406
type: string

0 commit comments

Comments
 (0)