-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INSIGHTS-528 cli opa validation: Support multiple rules that return v…
…alues in OPA (#221) * INSIGHTS-528 cli opa validation: Support multiple rules that return values in OPA * INSIGHTS-528 cli opa validation: Support multiple rules that return values in OPA
- Loading branch information
Showing
3 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package fairwinds | ||
foo := {"s": "foo"} | ||
envMaxReplicasDeployments[actionItem] { | ||
print(foo.s) | ||
input.kind == "Deployment" | ||
env_suffix := array.reverse(split(input.metadata.namespace, "-"))[0] | ||
replicas := input.spec.replicas | ||
actionItem := { | ||
"title": "Non-production environment replica count exceeds maximum", | ||
"description": sprintf("The Deployment %v in the %v environment replicas exceed the maximum replica count for this environment.", [input.metadata.name, env_suffix]), | ||
"severity": 0.5, | ||
"remediation": "Reduce the number of replicas", | ||
"category": "Reliability" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters