Skip to content

Commit 99d4d36

Browse files
author
Rino Rondan
committed
removed validationFailureAction and replaced by failureAction in folder argo,argo-cel,aws,best-practices
Signed-off-by: Rino Rondan <[email protected]>
1 parent ebc3671 commit 99d4d36

File tree

44 files changed

+61
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+61
-45
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Anyone and everyone is welcome to write and contribute Kyverno policies! We have
2525

2626
* Provide test resources (where possible) which allow your policy to be validated using the Kyverno CLI. See an example of a complete policy, resource, and test [here](https://github.com/kyverno/policies/tree/main/pod-security/baseline/disallow-capabilities). If unfamiliar with the Kyverno CLI and its test ability, please see the documentation [here](https://kyverno.io/docs/testing-policies/).
2727

28-
* For `validate` rules, please set `validationFailureAction: Audit` so that should a user download and apply the policy without having a yet full understanding of Kyverno, it will not cause unintended harm to their environment by blocking resources.
28+
* For `validate` rules, please set `failureAction: Audit` so that should a user download and apply the policy without having a yet full understanding of Kyverno, it will not cause unintended harm to their environment by blocking resources.
2929

3030
* String values do not need to be quoted nor do values which contain JMESPath expressions such as `{{request.operation}}`. The exception is if a field's value is *only* such an expression. In those cases, the JMESPath expression needs to be double quoted.
3131

@@ -59,10 +59,11 @@ metadata:
5959
policies.kyverno.io/description: >-
6060
Adding capabilities beyond those listed in the policy must be disallowed.
6161
spec:
62-
validationFailureAction: Audit
6362
background: true
6463
rules:
6564
- name: my-rule-name
65+
validate:
66+
failureAction: Audit
6667
match:
6768
any:
6869
- resources:

argo-cel/application-field-validation/application-field-validation.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ metadata:
1515
Path or chart must be specified but never both. And destination.name or
1616
destination.server must be specified but never both.
1717
spec:
18-
validationFailureAction: Audit
1918
background: true
2019
rules:
2120
- name: source-path-chart
@@ -28,6 +27,7 @@ spec:
2827
- CREATE
2928
- UPDATE
3029
validate:
30+
failureAction: Audit
3131
cel:
3232
expressions:
3333
- expression: >-
@@ -48,6 +48,7 @@ spec:
4848
- CREATE
4949
- UPDATE
5050
validate:
51+
failureAction: Audit
5152
cel:
5253
expressions:
5354
- expression: >-

argo-cel/application-prevent-default-project/application-prevent-default-project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ metadata:
1313
policies.kyverno.io/description: >-
1414
This policy prevents the use of the default project in an Application.
1515
spec:
16-
validationFailureAction: Audit
1716
background: true
1817
rules:
1918
- name: default-project
@@ -26,6 +25,7 @@ spec:
2625
- CREATE
2726
- UPDATE
2827
validate:
28+
failureAction: Audit
2929
cel:
3030
expressions:
3131
- expression: "object.spec.?project.orValue('') != 'default'"

argo-cel/application-prevent-updates-project/application-prevent-updates-project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ metadata:
1212
policies.kyverno.io/description: >-
1313
This policy prevents updates to the project field after an Application is created.
1414
spec:
15-
validationFailureAction: Audit
1615
background: true
1716
rules:
1817
- name: project-updates
@@ -25,6 +24,7 @@ spec:
2524
- name: "operation-should-be-update"
2625
expression: "request.operation == 'UPDATE'"
2726
validate:
27+
failureAction: Audit
2828
cel:
2929
expressions:
3030
- expression: "object.spec.project == oldObject.spec.project"

argo-cel/applicationset-name-matches-project/applicationset-name-matches-project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ metadata:
1414
This policy ensures that the name of the ApplicationSet is the
1515
same value provided in the project.
1616
spec:
17-
validationFailureAction: Audit
1817
background: true
1918
rules:
2019
- name: match-name
@@ -27,6 +26,7 @@ spec:
2726
- CREATE
2827
- UPDATE
2928
validate:
29+
failureAction: Audit
3030
cel:
3131
expressions:
3232
- expression: "object.spec.template.spec.project == object.metadata.name"

argo-cel/appproject-clusterresourceblacklist/appproject-clusterresourceblacklist.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ metadata:
1717
enforce that all AppProjects specify clusterResourceBlacklist and that their group
1818
and kind have wildcards as values.
1919
spec:
20-
validationFailureAction: Audit
2120
background: true
2221
rules:
2322
- name: has-wildcard-and-validate-clusterresourceblacklist
@@ -30,6 +29,7 @@ spec:
3029
- CREATE
3130
- UPDATE
3231
validate:
32+
failureAction: Audit
3333
cel:
3434
expressions:
3535
- expression: "has(object.spec.clusterResourceBlacklist)"

argo/application-field-validation/application-field-validation.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ metadata:
1515
Path or chart must be specified but never both. And destination.name or
1616
destination.server must be specified but never both.
1717
spec:
18-
validationFailureAction: Audit
1918
background: true
2019
rules:
2120
- name: source-path-chart
@@ -25,6 +24,7 @@ spec:
2524
kinds:
2625
- Application
2726
validate:
27+
failureAction: Audit
2828
message: >-
2929
`spec.source.path` OR `spec.source.chart` should be specified but never both.
3030
anyPattern:
@@ -43,6 +43,7 @@ spec:
4343
kinds:
4444
- Application
4545
validate:
46+
failureAction: Audit
4647
message: >-
4748
`spec.destination.server` OR `spec.destination.name` should be specified but never both.
4849
anyPattern:

argo/application-prevent-default-project/application-prevent-default-project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ metadata:
1313
policies.kyverno.io/description: >-
1414
This policy prevents the use of the default project in an Application.
1515
spec:
16-
validationFailureAction: Audit
1716
background: true
1817
rules:
1918
- name: default-project
@@ -28,6 +27,7 @@ spec:
2827
operator: NotEquals
2928
value: DELETE
3029
validate:
30+
failureAction: Audit
3131
message: "The default project may not be used in an Application."
3232
pattern:
3333
spec:

argo/application-prevent-updates-project/application-prevent-updates-project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ metadata:
1313
policies.kyverno.io/description: >-
1414
This policy prevents updates to the project field after an Application is created.
1515
spec:
16-
validationFailureAction: Audit
1716
background: true
1817
rules:
1918
- name: project-updates
@@ -28,6 +27,7 @@ spec:
2827
operator: Equals
2928
value: UPDATE
3029
validate:
30+
failureAction: Audit
3131
message: "The spec.project cannot be changed once the Application is created."
3232
deny:
3333
conditions:

argo/applicationset-name-matches-project/applicationset-name-matches-project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ metadata:
1414
This policy ensures that the name of the ApplicationSet is the
1515
same value provided in the project.
1616
spec:
17-
validationFailureAction: Audit
1817
background: true
1918
rules:
2019
- name: match-name
@@ -29,6 +28,7 @@ spec:
2928
operator: NotEquals
3029
value: DELETE
3130
validate:
31+
failureAction: Audit
3232
message: "The name must match the project."
3333
pattern:
3434
spec:

0 commit comments

Comments
 (0)