Skip to content
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

Update ILM add validation to accept with noncurrent-transition-newer set #4732

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions cmd/ilm/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ func (opts LifecycleOptions) ToILMRule() (lifecycle.Rule, *probe.Error) {
StorageClass: nonCurrentVersionTransitionStorageClass,
},
}

if err := validateILMRule(newRule); err != nil {
return lifecycle.Rule{}, err
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))
}
Expand Down
Loading