Skip to content

Commit 64199a9

Browse files
committed
Add componentNames field to VolatileCriteria
Add optional componentNames field to allow filtering volatile config include/exclude rules by component name from ApplicationSnapshot. Example usage: volatileConfig: exclude: - value: "lint.has_failures" componentNames: ["component1", "component2"] Ref: https://issues.redhat.com/browse/EC-1513 Assisted-by: Cursor (using claude-4.5-sonnet)
1 parent e1d2a37 commit 64199a9

6 files changed

Lines changed: 58 additions & 2 deletions

File tree

api/config/appstudio.redhat.com_enterprisecontractpolicies.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ spec:
159159
items:
160160
description: VolatileCriteria includes or excludes a policy rule with effective dates as an option.
161161
properties:
162+
componentNames:
163+
description: |-
164+
ComponentNames is used to specify component names from ApplicationSnapshot.
165+
items:
166+
type: string
167+
minItems: 1
168+
type: array
169+
x-kubernetes-list-type: set
162170
effectiveOn:
163171
format: date-time
164172
type: string
@@ -195,6 +203,14 @@ spec:
195203
items:
196204
description: VolatileCriteria includes or excludes a policy rule with effective dates as an option.
197205
properties:
206+
componentNames:
207+
description: |-
208+
ComponentNames is used to specify component names from ApplicationSnapshot.
209+
items:
210+
type: string
211+
minItems: 1
212+
type: array
213+
x-kubernetes-list-type: set
198214
effectiveOn:
199215
format: date-time
200216
type: string

api/v1alpha1/enterprisecontractpolicy_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ type VolatileCriteria struct {
116116
// +kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9.-]*[a-z0-9](?:\/[a-z0-9][a-z0-9-]*[a-z0-9]){2,}$`
117117
ImageUrl string `json:"imageUrl,omitempty"`
118118

119+
// ComponentNames is used to specify component names from ApplicationSnapshot.
120+
// +optional
121+
// +kubebuilder:validation:MinItems:=1
122+
// +kubebuilder:validation:items:MinLength:=1
123+
// +listType:=set
124+
ComponentNames []string `json:"componentNames,omitempty"`
125+
119126
// Reference is used to include a link to related information such as a Jira issue URL.
120127
// +optional
121128
Reference string `json:"reference,omitempty"`

api/v1alpha1/policy_spec.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
"type": "string",
181181
"description": "ImageUrl is used to specify an image by its URL without a tag.\n+optional\n+kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9.-]*[a-z0-9](?:\\/[a-z0-9][a-z0-9-]*[a-z0-9]){2,}$`"
182182
},
183+
"componentNames": {
184+
"items": {
185+
"type": "string"
186+
},
187+
"type": "array",
188+
"description": "ComponentNames is used to specify component names from ApplicationSnapshot.\n+optional\n+kubebuilder:validation:MinItems:=1\n+kubebuilder:validation:items:MinLength:=1\n+listType:=set"
189+
},
183190
"reference": {
184191
"type": "string",
185192
"description": "Reference is used to include a link to related information such as a Jira issue URL.\n+optional"

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/appstudio.redhat.com_enterprisecontractpolicies.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ spec:
159159
items:
160160
description: VolatileCriteria includes or excludes a policy rule with effective dates as an option.
161161
properties:
162+
componentNames:
163+
description: |-
164+
ComponentNames is used to specify component names from ApplicationSnapshot.
165+
items:
166+
type: string
167+
minItems: 1
168+
type: array
169+
x-kubernetes-list-type: set
162170
effectiveOn:
163171
format: date-time
164172
type: string
@@ -195,6 +203,14 @@ spec:
195203
items:
196204
description: VolatileCriteria includes or excludes a policy rule with effective dates as an option.
197205
properties:
206+
componentNames:
207+
description: |-
208+
ComponentNames is used to specify component names from ApplicationSnapshot.
209+
items:
210+
type: string
211+
minItems: 1
212+
type: array
213+
x-kubernetes-list-type: set
198214
effectiveOn:
199215
format: date-time
200216
type: string

docs/modules/ROOT/pages/reference.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ Appears In: xref:{anchor_prefix}-github-com-enterprise-contract-enterprise-contr
205205
ImageRef is used to specify an image by its digest. +
206206
| *`imageDigest`* __string__ | ImageDigest is used to specify an image by its digest. +
207207
| *`imageUrl`* __string__ | ImageUrl is used to specify an image by its URL without a tag. +
208+
| *`componentNames`* __string array__ | ComponentNames is used to specify component names from ApplicationSnapshot. +
208209
| *`reference`* __string__ | Reference is used to include a link to related information such as a Jira issue URL. +
209210
|===
210211

0 commit comments

Comments
 (0)