Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit 38b1f68

Browse files
author
hadar-co
authored
fix: exclude knative crd from rule constraints (#954)
1 parent d00c364 commit 38b1f68

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

pkg/defaultRules/defaultRules.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,12 @@ rules:
301301
kind:
302302
enum:
303303
- Service
304+
# knative has a CRD with kind "Service", we want this rule to ignore it
305+
not:
306+
properties:
307+
apiVersion:
308+
enum:
309+
- serving.knative.dev/v1
304310
then:
305311
properties:
306312
spec:

pkg/policy/tests/7/pass/7-pass-2.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: serving.knative.dev/v1
2+
kind: Service
3+
metadata:
4+
creationTimestamp: null
5+
name: hadartest
6+
namespace: knative-serving-demo-0
7+
spec:
8+
type: NodePort
9+
template:
10+
metadata:
11+
annotations:
12+
client.knative.dev/updateTimestamp: "2023-07-06T10:38:55Z"
13+
client.knative.dev/user-image: gcr.io/knative-samples/helloworld-go
14+
creationTimestamp: null
15+
spec:
16+
containers:
17+
- image: gcr.io/knative-samples/helloworld-go
18+
name: ""
19+
ports:
20+
- containerPort: 8080
21+
resources: {}
22+
status: {}

0 commit comments

Comments
 (0)