-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat(constraint): add new argo-workflow-gc constraint #49
base: master
Are you sure you want to change the base?
Conversation
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.
I think this is a good start. Have we thought about using a Mutation to automatically set the GC settings? This might be a good place to do it since it looks to be a pretty simple policy and there isn't too much to change. It could be interesting to have both the mutation and the policy in case, defense in depth. (mutations are run first, then the admission policy so it should work fine!)
Can you add some newline at the end of files? Just some lil' nitpicks :)
package argoworkflowgc | ||
|
||
violation[{"msg": msg}] { | ||
input.review.kind.kind == "Workflow" | ||
not input.review.object.spec.podGC | ||
|
||
msg := sprintf("podGC field is required in an Argo Workflow manifest. %s", [input.parameters.errorMsgAdditionalDetails]) | ||
} |
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.
Looks like the violation for CronWorkflows
is missing.
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.
Added!
Thanks for the reviewing the PR! Good point, I think the mutation idea sounds interesting & useful! I'll look into it. |
All Argo Workflows should have the podGC field set (https://argoproj.github.io/argo-workflows/fields/#podgc).