Skip to content

Instantly share code, notes, and snippets.

@sbueringer
Created February 18, 2019 20:56
Show Gist options
  • Save sbueringer/47e506d269b883794b412b13d425552d to your computer and use it in GitHub Desktop.
Save sbueringer/47e506d269b883794b412b13d425552d to your computer and use it in GitHub Desktop.
blog-opa-perf-old-object.rego.rb
deny[{"id": id, "resource": {"kind": "namespaces", "namespace": "", "name": "YhPygPfFUx"}, "resolution": resolution}]
with data["kubernetes"]["namespaces"][""]["YhPygPfFUx"] as {
"uid":"f9603bca-33ab-11e9-9711-fa163e2ecb1b",
"kind":{
"group":"",
"version":"v1",
"kind":"Namespace"
},
"resource":{
"group":"",
"version":"v1",
"resource":"namespaces"},
"operation":"UPDATE",
"userInfo":{
"username":"system:serviceaccount:test:helm-controller",
"uid":"1471011f-f954-11e8-8752-fa163e203532",
"groups":[
"system:serviceaccounts",
"system:serviceaccounts:test",
"system:authenticated"
]
},
"object":{
"metadata":{
"name":"test-ns",
"uid":"f960392a-33ab-11e9-9711-fa163e2ecb1b",
"creationTimestamp":"2019-02-18T18:35:32Z",
"labels":{
"stage":"prod"
}
},
"spec":{
"finalizers":["kubernetes"]
},
"status":{"phase":"Active"}
},
"oldObject":{
"metadata":{
"name":"test-ns",
"uid":"f960392a-33ab-11e9-9711-fa163e2ecb1b",
"creationTimestamp":"2019-02-18T18:35:32Z",
},
"spec":{
"finalizers":["kubernetes"]
},
"status":{"phase":"Active"}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment