Skip to content

Commit 39bf627

Browse files
authored
Enable console to set expired-object-all-versions (#3226)
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
1 parent a838c76 commit 39bf627

15 files changed

+123
-3
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ lint:
3333
@GO111MODULE=on ${GOPATH}/bin/golangci-lint cache clean
3434
@GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=5m --config ./.golangci.yml
3535

36+
lint-fix: getdeps ## runs golangci-lint suite of linters with automatic fixes
37+
@echo "Running $@ check"
38+
@GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=5m --config ./.golangci.yml --fix
39+
3640
install: console
3741
@echo "Installing console binary to '$(GOPATH)/bin/console'"
3842
@mkdir -p $(GOPATH)/bin && cp -f $(PWD)/console $(GOPATH)/bin/console

api/embedded_spec.go

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/user_buckets_lifecycle.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func getBucketLifecycle(ctx context.Context, client MinioClient, bucketName stri
117117
Date: rule.Expiration.Date.Format(time.RFC3339),
118118
Days: int64(rule.Expiration.Days),
119119
DeleteMarker: rule.Expiration.DeleteMarker.IsEnabled(),
120+
DeleteAll: bool(rule.Expiration.DeleteAll),
120121
NoncurrentExpirationDays: int64(rule.NoncurrentVersionExpiration.NoncurrentDays),
121122
NewerNoncurrentExpirationVersions: int64(rule.NoncurrentVersionExpiration.NewerNoncurrentVersions),
122123
},
@@ -188,6 +189,7 @@ func addBucketLifecycle(ctx context.Context, client MinioClient, params bucketAp
188189
Status: &status,
189190
Tags: &params.Body.Tags,
190191
ExpiredObjectDeleteMarker: &params.Body.ExpiredObjectDeleteMarker,
192+
ExpiredObjectAllversions: &params.Body.ExpiredObjectDeleteAll,
191193
}
192194

193195
if params.Body.NoncurrentversionTransitionDays > 0 {
@@ -219,6 +221,7 @@ func addBucketLifecycle(ctx context.Context, client MinioClient, params bucketAp
219221
Status: &status,
220222
Tags: &params.Body.Tags,
221223
ExpiredObjectDeleteMarker: &params.Body.ExpiredObjectDeleteMarker,
224+
ExpiredObjectAllversions: &params.Body.ExpiredObjectDeleteAll,
222225
}
223226

224227
if params.Body.NewerNoncurrentversionExpirationVersions > 0 {
@@ -298,6 +301,7 @@ func editBucketLifecycle(ctx context.Context, client MinioClient, params bucketA
298301
Status: &status,
299302
Tags: &params.Body.Tags,
300303
ExpiredObjectDeleteMarker: &params.Body.ExpiredObjectDeleteMarker,
304+
ExpiredObjectAllversions: &params.Body.ExpiredObjectDeleteAll,
301305
}
302306

303307
if params.Body.NoncurrentversionTransitionDays > 0 {
@@ -328,6 +332,7 @@ func editBucketLifecycle(ctx context.Context, client MinioClient, params bucketA
328332
Status: &status,
329333
Tags: &params.Body.Tags,
330334
ExpiredObjectDeleteMarker: &params.Body.ExpiredObjectDeleteMarker,
335+
ExpiredObjectAllversions: &params.Body.ExpiredObjectDeleteAll,
331336
}
332337

333338
if params.Body.NoncurrentversionExpirationDays > 0 {
@@ -456,6 +461,7 @@ func addMultiBucketLifecycle(ctx context.Context, client MinioClient, params buc
456461
ExpiryDays: params.Body.ExpiryDays,
457462
Disable: false,
458463
ExpiredObjectDeleteMarker: params.Body.ExpiredObjectDeleteMarker,
464+
ExpiredObjectDeleteAll: params.Body.ExpiredObjectDeleteMarker,
459465
}
460466

461467
go func() {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/minio/highwayhash v1.0.2
2323
github.com/minio/kes v0.23.0
2424
github.com/minio/madmin-go/v3 v3.0.46
25-
github.com/minio/mc v0.0.0-20240209221824-669cb0a9a475
25+
github.com/minio/mc v0.0.0-20240224013320-f17313e7ab89
2626
github.com/minio/minio-go/v7 v7.0.67
2727
github.com/minio/selfupdate v0.6.0
2828
github.com/minio/websocket v1.6.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ github.com/minio/kes-go v0.2.1 h1:KnqS+p6xoSFJZbQhmJaz/PbxeA6nQyRqT/ywrn5lU2o=
189189
github.com/minio/kes-go v0.2.1/go.mod h1:76xf7l41Wrh+IifisABXK2S8uZWYgWV1IGBKC3GdOJk=
190190
github.com/minio/madmin-go/v3 v3.0.46 h1:DabFt+aUph5Vu/SOat2RWN/xVagPBU7qzxhAQ03hH/k=
191191
github.com/minio/madmin-go/v3 v3.0.46/go.mod h1:ZDF7kf5fhmxLhbGTqyq5efs4ao0v4eWf7nOuef/ljJs=
192-
github.com/minio/mc v0.0.0-20240209221824-669cb0a9a475 h1:yfLzMougcV2xkVlWgwYwVRoT8pnXrcCV4oOQW+pI2EQ=
193-
github.com/minio/mc v0.0.0-20240209221824-669cb0a9a475/go.mod h1:MmDLdb7NWd/OYhcKcXKvwErq2GNa/Zq6xtTWuhdC4II=
192+
github.com/minio/mc v0.0.0-20240224013320-f17313e7ab89 h1:XM7YTVWU46a1P+8h7+xMCQXJEIdU+MEFp9BZM7ImeVI=
193+
github.com/minio/mc v0.0.0-20240224013320-f17313e7ab89/go.mod h1:RBhdjMeCia7yxC9jQ2onV7kPvruzWBgtSa/h2zm1egc=
194194
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
195195
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
196196
github.com/minio/minio-go/v7 v7.0.67 h1:BeBvZWAS+kRJm1vGTMJYVjKUNoo0FoEt/wUWdUtfmh8=

models/add_bucket_lifecycle.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/add_multi_bucket_lifecycle.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/expiration_response.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/update_bucket_lifecycle.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5109,6 +5109,8 @@ definitions:
51095109
format: int64
51105110
delete_marker:
51115111
type: boolean
5112+
delete_all:
5113+
type: boolean
51125114
noncurrent_expiration_days:
51135115
type: integer
51145116
format: int64
@@ -5192,6 +5194,9 @@ definitions:
51925194
expired_object_delete_marker:
51935195
description: Non required, toggle to disable or enable rule
51945196
type: boolean
5197+
expired_object_delete_all:
5198+
description: Non required, toggle to disable or enable rule
5199+
type: boolean
51955200
noncurrentversion_expiration_days:
51965201
description: Non required, can be set in case of expiration is enabled
51975202
type: integer
@@ -5247,6 +5252,9 @@ definitions:
52475252
expired_object_delete_marker:
52485253
description: Non required, toggle to disable or enable rule
52495254
type: boolean
5255+
expired_object_delete_all:
5256+
description: Non required, toggle to disable or enable rule
5257+
type: boolean
52505258
noncurrentversion_expiration_days:
52515259
description: Non required, can be set in case of expiration is enabled
52525260
type: integer
@@ -5299,6 +5307,9 @@ definitions:
52995307
expired_object_delete_marker:
53005308
description: Non required, toggle to disable or enable rule
53015309
type: boolean
5310+
expired_object_delete_all:
5311+
description: Non required, toggle to disable or enable rule
5312+
type: boolean
53025313
noncurrentversion_expiration_days:
53035314
description: Non required, can be set in case of expiration is enabled
53045315
type: integer

0 commit comments

Comments
 (0)