Skip to content

Instantly share code, notes, and snippets.

@swade1987
Created March 25, 2020 09:25
Show Gist options
  • Save swade1987/5c49a8ecbb9e03afb2d6da60047ea664 to your computer and use it in GitHub Desktop.
Save swade1987/5c49a8ecbb9e03afb2d6da60047ea664 to your computer and use it in GitHub Desktop.
rego policy example
# daemonsets, deployments, replicasets resources under extensions/v1beta1 - use apps/v1 instead
_deny = msg {
resources := ["DaemonSet", "Deployment", "ReplicaSet"]
input.apiVersion == "extensions/v1beta1"
input.kind == resources[_]
msg := sprintf("%s/%s: API extensions/v1beta1 for %s has been deprecated, use apps/v1 instead.", [input.kind, input.metadata.name, input.kind])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment