Skip to content

Commit

Permalink
revert pruner keep and keep-since simultaneous support
Browse files Browse the repository at this point in the history
Signed-off-by: Jeeva Kandasamy <[email protected]>
  • Loading branch information
jkandasa authored and tekton-robot committed Apr 13, 2023
1 parent c03c566 commit 1d0fb8d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/apis/operator/v1alpha1/tektonconfig_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ func (p Prune) validate() *apis.FieldError {
errs = errs.Also(apis.ErrMissingField("spec.pruner.resources"))
}

// tkn cli supports both "keep" and "keep-since", even though there is an issue with the logic
// when we supply both "keep" and "keep-since", the outcome always equivalent to "keep", "keep-since" ignored
// hence we strict with a single flag support until the issue is fixed in tkn cli
// cli issue: https://github.com/tektoncd/cli/issues/1990
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"))
}
Expand Down

0 comments on commit 1d0fb8d

Please sign in to comment.