Skip to content

Commit

Permalink
add back case
Browse files Browse the repository at this point in the history
Signed-off-by: YiscahLevySilas1 <[email protected]>
  • Loading branch information
YiscahLevySilas1 committed Oct 9, 2023
1 parent 8599570 commit 54f0e3a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rules/k8s-common-labels-usage/raw.rego
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ no_K8s_label_or_no_K8s_label_usage(wl, beggining_of_path) = path{
path = [{"path": sprintf("%vmetadata.labels.%v", [beggining_of_path, label_key]), "value": "YOUR_VALUE"}]
}

no_K8s_label_or_no_K8s_label_usage(wl, beggining_of_path) = path{
metadata := wl.metadata
not metadata.labels
label_key := get_label_key("")
path = [{"path": sprintf("%vmetadata.labels.%v", [beggining_of_path, label_key]), "value": "YOUR_VALUE"}]
}

no_K8s_label_or_no_K8s_label_usage(wl, beggining_of_path) = path{
labels := wl.metadata.labels
not all_kubernetes_labels(labels)
Expand Down

0 comments on commit 54f0e3a

Please sign in to comment.