diff --git a/cmd/ilm/options.go b/cmd/ilm/options.go index 6a0fdab823..49aa0a90fa 100644 --- a/cmd/ilm/options.go +++ b/cmd/ilm/options.go @@ -159,7 +159,6 @@ func (opts LifecycleOptions) ToILMRule() (lifecycle.Rule, *probe.Error) { StorageClass: nonCurrentVersionTransitionStorageClass, }, } - if err := validateILMRule(newRule); err != nil { return lifecycle.Rule{}, err } @@ -254,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") { - return LifecycleOptions{}, probe.NewError(errors.New("noncurrentversion-transition-days 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 @@ -300,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)) }