Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 0b881c2

Browse files
committed
#33 Add cascading attribute to select cascading rules based on labels
1 parent 3549e9a commit 0b881c2

File tree

5 files changed

+148
-0
lines changed

5 files changed

+148
-0
lines changed

operator/apis/execution/v1/scan_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ type ScanSpec struct {
3131
ScanType string `json:"scanType,omitempty"`
3232

3333
Parameters []string `json:"parameters,omitempty"`
34+
35+
Cascades *metav1.LabelSelector `json:"cascades,omitempty"`
3436
}
3537

3638
// ScanStatus defines the observed state of Scan

operator/apis/execution/v1/zz_generated.deepcopy.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/config/crd/bases/cascading.experimental.securecodebox.io_cascadingrules.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,53 @@ spec:
6969
scanSpec:
7070
description: ScanSpec defines how the cascaded scan should look like
7171
properties:
72+
cascades:
73+
description: A label selector is a label query over a set of resources.
74+
The result of matchLabels and matchExpressions are ANDed. An empty
75+
label selector matches all objects. A null label selector matches
76+
no objects.
77+
properties:
78+
matchExpressions:
79+
description: matchExpressions is a list of label selector requirements.
80+
The requirements are ANDed.
81+
items:
82+
description: A label selector requirement is a selector that
83+
contains values, a key, and an operator that relates the
84+
key and values.
85+
properties:
86+
key:
87+
description: key is the label key that the selector applies
88+
to.
89+
type: string
90+
operator:
91+
description: operator represents a key's relationship
92+
to a set of values. Valid operators are In, NotIn, Exists
93+
and DoesNotExist.
94+
type: string
95+
values:
96+
description: values is an array of string values. If the
97+
operator is In or NotIn, the values array must be non-empty.
98+
If the operator is Exists or DoesNotExist, the values
99+
array must be empty. This array is replaced during a
100+
strategic merge patch.
101+
items:
102+
type: string
103+
type: array
104+
required:
105+
- key
106+
- operator
107+
type: object
108+
type: array
109+
matchLabels:
110+
additionalProperties:
111+
type: string
112+
description: matchLabels is a map of {key,value} pairs. A single
113+
{key,value} in the matchLabels map is equivalent to an element
114+
of matchExpressions, whose key field is "key", the operator
115+
is "In", and the values array contains only "value". The requirements
116+
are ANDed.
117+
type: object
118+
type: object
72119
parameters:
73120
items:
74121
type: string

operator/config/crd/bases/execution.experimental.securecodebox.io_scans.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,52 @@ spec:
5959
spec:
6060
description: ScanSpec defines the desired state of Scan
6161
properties:
62+
cascades:
63+
description: A label selector is a label query over a set of resources.
64+
The result of matchLabels and matchExpressions are ANDed. An empty
65+
label selector matches all objects. A null label selector matches
66+
no objects.
67+
properties:
68+
matchExpressions:
69+
description: matchExpressions is a list of label selector requirements.
70+
The requirements are ANDed.
71+
items:
72+
description: A label selector requirement is a selector that contains
73+
values, a key, and an operator that relates the key and values.
74+
properties:
75+
key:
76+
description: key is the label key that the selector applies
77+
to.
78+
type: string
79+
operator:
80+
description: operator represents a key's relationship to a
81+
set of values. Valid operators are In, NotIn, Exists and
82+
DoesNotExist.
83+
type: string
84+
values:
85+
description: values is an array of string values. If the operator
86+
is In or NotIn, the values array must be non-empty. If the
87+
operator is Exists or DoesNotExist, the values array must
88+
be empty. This array is replaced during a strategic merge
89+
patch.
90+
items:
91+
type: string
92+
type: array
93+
required:
94+
- key
95+
- operator
96+
type: object
97+
type: array
98+
matchLabels:
99+
additionalProperties:
100+
type: string
101+
description: matchLabels is a map of {key,value} pairs. A single
102+
{key,value} in the matchLabels map is equivalent to an element
103+
of matchExpressions, whose key field is "key", the operator is
104+
"In", and the values array contains only "value". The requirements
105+
are ANDed.
106+
type: object
107+
type: object
62108
parameters:
63109
items:
64110
type: string

operator/config/crd/bases/execution.experimental.securecodebox.io_scheduledscans.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,53 @@ spec:
7474
description: Foo is an example field of ScheduledScan. Edit ScheduledScan_types.go
7575
to remove/update
7676
properties:
77+
cascades:
78+
description: A label selector is a label query over a set of resources.
79+
The result of matchLabels and matchExpressions are ANDed. An empty
80+
label selector matches all objects. A null label selector matches
81+
no objects.
82+
properties:
83+
matchExpressions:
84+
description: matchExpressions is a list of label selector requirements.
85+
The requirements are ANDed.
86+
items:
87+
description: A label selector requirement is a selector that
88+
contains values, a key, and an operator that relates the
89+
key and values.
90+
properties:
91+
key:
92+
description: key is the label key that the selector applies
93+
to.
94+
type: string
95+
operator:
96+
description: operator represents a key's relationship
97+
to a set of values. Valid operators are In, NotIn, Exists
98+
and DoesNotExist.
99+
type: string
100+
values:
101+
description: values is an array of string values. If the
102+
operator is In or NotIn, the values array must be non-empty.
103+
If the operator is Exists or DoesNotExist, the values
104+
array must be empty. This array is replaced during a
105+
strategic merge patch.
106+
items:
107+
type: string
108+
type: array
109+
required:
110+
- key
111+
- operator
112+
type: object
113+
type: array
114+
matchLabels:
115+
additionalProperties:
116+
type: string
117+
description: matchLabels is a map of {key,value} pairs. A single
118+
{key,value} in the matchLabels map is equivalent to an element
119+
of matchExpressions, whose key field is "key", the operator
120+
is "In", and the values array contains only "value". The requirements
121+
are ANDed.
122+
type: object
123+
type: object
77124
parameters:
78125
items:
79126
type: string

0 commit comments

Comments
 (0)