http.send() issue #510
Unanswered
andrepcb
asked this question in
OPA and Rego
Replies: 1 comment 3 replies
-
In order to understand exactly what your OPA instance receives, I'd suggest enabling decision logging. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently trying to write a rego policy to stop "kubectl scale" when CPU utilization is too high. The code seems to be fine when using "opa eval..." but is bypassed in reality. Is it maybe an issue with my admission controller?
Note "Deployment" has same issue"
`package kubernetes.admission
operations := {"CREATE", "UPDATE"}
getCPUtilization = response {
response := http.send({
"method": "GET",
"url": "http:example.com",
})
}
deny[msg] {
input.request.kind.kind = "Scale"
operations[input.request.operation]
cpu_util := getCPUtilization.body
cpu_util > 10
msg = sprintf("denied: %v", [cpu_util])
}
`
Beta Was this translation helpful? Give feedback.
All reactions