-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow custom label openpolicyagent.org/policy=rego #89
Conversation
…/custom label. Signed-off-by: Kirk Patton <kpatton@verizonmedia.com>
cmd/kube-mgmt/main.go
Outdated
rootCmd.Flags().StringVarP(¶ms.policyLabel, "policy-label", "", "", "replace label openpolicyagent.org/policy") | ||
rootCmd.Flags().StringVarP(¶ms.policyValue, "policy-value", "", "", "replace value rego") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we make the default values "openpolicyagent.org/policy"
and "rego"
. Then we just have to plumb the values into the configmap watcher.
pkg/configmap/configmap.go
Outdated
return "", err | ||
} | ||
|
||
policyLabelKey = key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrmmm. Those values were defined as globals because they weren't changing (i.e., they ought to have been consts). I would rather make the main() function pass the values into the watcher as parameters rather than relying on mutable global state.
Signed-off-by: Kirk Patton <kpatton@verizonmedia.com>
@tsandall does the update address your noted feedback? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Thanks @kirk-patton !
--policy-label=my.org/policy
--policy-value=mutating
I would like two run separate OPA servers using the same policy namespace. Currently openpolicyagent.org/policy=rego" is hard coded.