Skip to content

Commit

Permalink
Remove noncurrentversion-transition-days, improve error wording for c…
Browse files Browse the repository at this point in the history
…larity
  • Loading branch information
Jillian Inapurapu authored and Jillian Inapurapu committed Oct 26, 2023
1 parent 8ad6597 commit b39a492
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/ilm/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ func GetLifecycleOptions(ctx *cli.Context) (LifecycleOptions, *probe.Error) {
if tier != nil && !ctx.IsSet("transition-days") && !ctx.IsSet("transition-date") {
return LifecycleOptions{}, probe.NewError(errors.New("transition-date or transition-days must be set"))
}
if noncurrentTier != nil && !ctx.IsSet("noncurrentversion-transition-days") && !ctx.IsSet("noncurrent-transition-days") && !ctx.IsSet("noncurrent-transition-newer") {
return LifecycleOptions{}, probe.NewError(errors.New("noncurrentversion-transition-days must be set or noncurrent version count must be set"))
if noncurrentTier != nil && !ctx.IsSet("noncurrent-transition-days") && !ctx.IsSet("noncurrent-transition-newer") {
return LifecycleOptions{}, probe.NewError(errors.New("noncurrent-transition-days or noncurrent-transition-newer must be set"))
}
// for MinIO transition storage-class is same as label defined on
// `mc admin bucket remote add --service ilm --label` command
Expand Down Expand Up @@ -299,9 +299,6 @@ func GetLifecycleOptions(ctx *cli.Context) (LifecycleOptions, *probe.Error) {
if f := "noncurrent-expire-newer"; ctx.IsSet(f) {
newerNoncurrentExpirationVersions = intPtr(ctx.Int(f))
}
if ctx.IsSet("noncurrentversion-transition-days") {
noncurrentVersionTransitionDays = intPtr(ctx.Int("noncurrentversion-transition-days"))
}
if f := "noncurrent-transition-days"; ctx.IsSet(f) {
noncurrentVersionTransitionDays = intPtr(ctx.Int(f))
}
Expand Down

0 comments on commit b39a492

Please sign in to comment.