-
Notifications
You must be signed in to change notification settings - Fork 238
adds auto-prune per namespace #410
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,10 +64,15 @@ func (p Prune) validate() *apis.FieldError { | |
| errs = errs.Also(apis.ErrMissingField("spec.pruner.resources")) | ||
| } | ||
|
|
||
| if p.Keep == nil { | ||
| errs = errs.Also(apis.ErrMissingField("spec.pruner.keep")) | ||
| } else if *p.Keep == 0 { | ||
| if p.Keep != nil && p.KeepSince != nil { | ||
| errs = errs.Also(apis.ErrMultipleOneOf("spec.pruner.keep", "spec.pruner.keep-since")) | ||
| } | ||
| if p.Keep == nil && p.KeepSince == nil { | ||
| errs = errs.Also(apis.ErrMissingOneOf("spec.pruner.keep", "spec.pruner.keep-since")) | ||
|
Comment on lines
+70
to
+71
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to error here, we can run
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so can we remove this check
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this check is required here, in the current approach without keep/keep-since we will have to use |
||
| } else if p.Keep != nil && *p.Keep == 0 { | ||
| errs = errs.Also(apis.ErrInvalidValue(*p.Keep, "spec.pruner.keep")) | ||
| } else if p.KeepSince != nil && *p.KeepSince == 0 { | ||
| errs = errs.Also(apis.ErrInvalidValue(*p.Keep, "spec.pruner.keep-since")) | ||
| } | ||
|
|
||
| if p.Schedule == "" { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.