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

Commit

Permalink
fix: exclude knative crd from rule constraints (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadar-co committed Jul 9, 2023
1 parent d00c364 commit 38b1f68
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/defaultRules/defaultRules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ rules:
kind:
enum:
- Service
# knative has a CRD with kind "Service", we want this rule to ignore it
not:
properties:
apiVersion:
enum:
- serving.knative.dev/v1
then:
properties:
spec:
Expand Down
22 changes: 22 additions & 0 deletions pkg/policy/tests/7/pass/7-pass-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
creationTimestamp: null
name: hadartest
namespace: knative-serving-demo-0
spec:
type: NodePort
template:
metadata:
annotations:
client.knative.dev/updateTimestamp: "2023-07-06T10:38:55Z"
client.knative.dev/user-image: gcr.io/knative-samples/helloworld-go
creationTimestamp: null
spec:
containers:
- image: gcr.io/knative-samples/helloworld-go
name: ""
ports:
- containerPort: 8080
resources: {}
status: {}

0 comments on commit 38b1f68

Please sign in to comment.