github.com/datreeio/datree@v1.9.22-rc/pkg/evaluation/test_fixtures/customRuleWithRegoCodeThatCantBeCompiled.yaml (about) 1 identifier: CUSTOM_DEPLOYMENT_BILLING_LABEL_EXISTS 2 name: Ensure Deployment has billing label [CUSTOM RULE] 3 defaultMessageOnFailure: deployment labels should contain billing label 4 schema: 5 if: 6 properties: 7 kind: 8 type: string 9 enum: 10 - Deployment 11 then: 12 regoDefinition: 13 libs: 14 - | 15 package lib.helpers 16 check_if_missing(missing) = isMissing { 17 isMissing := count(missing) > 0 18 } 19 code: | 20 package foosystemrequiredlabels 21 package foosystemrequiredlabels123 22 import data.lib.helpers 23 24 violation[labelIsMissing] { 25 provided := {label | input.metadata.labels[label]} 26 required := {"billing"} 27 missing := required - provided 28 labelIsMissing := helpers.check_if_missing(missing) 29 }