Skip to content

Commit

Permalink
add v1alpha2 custom check sample
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusfm committed Apr 16, 2024
1 parent df4c5a7 commit c9ebbeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ resources:
- zora_v1alpha1_cluster.yaml
- zora_v1alpha1_plugin.yaml
- zora_v1alpha1_clusterissue.yaml
- zora_v1alpha1_clusterscan.yaml
- zora_v1alpha1_customcheck.yaml
- zora_v1alpha1_clusterscan_misconfig.yaml
- zora_v1alpha1_clusterscan_vuln.yaml
- zora_v1alpha1_customcheck_replicas.yaml.yaml
- zora_v1alpha1_vulnerabilityreport.yaml
- zora_v1alpha2_customcheck_labels.yaml.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: zora.undistro.io/v1alpha1
apiVersion: zora.undistro.io/v1alpha2
kind: CustomCheck
metadata:
labels:
Expand All @@ -20,9 +20,12 @@ spec:
params:
requiredLabels:
- app
variables:
- expression: "'exempt' in object.metadata.labels && object.metadata.labels['exempt'] == 'true'"
name: exempt
validations:
- expression: >
has(object.metadata.labels) &&
variables.exempt ||
!object.metadata.labels.all(label,
params.requiredLabels.all(
req, req != label
Expand Down

0 comments on commit c9ebbeb

Please sign in to comment.