-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: Support bucket lifecycle for OSS artifact driver #5731
Conversation
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #5731 +/- ##
==========================================
- Coverage 46.93% 46.81% -0.12%
==========================================
Files 244 244
Lines 15220 15344 +124
==========================================
+ Hits 7143 7184 +41
- Misses 7171 7253 +82
- Partials 906 907 +1
Continue to review full report at Codecov.
|
// LifecycleRule specifies how to manage bucket's lifecycle | ||
type LifecycleRule struct { | ||
// MarkInfrequentAccessAfterDays is the number of days before we convert the objects in the bucket to Infrequent Access (IA) storage type | ||
MarkInfrequentAccessAfterDays *int32 `json:"markInfrequentAccessAfterDays,omitempty" protobuf:"bytes,1,opt,name=markInfrequentAccessAfterDays"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use pointer type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to make this consistent with other types in workflow.
Changed to int32.
versionExpiration := oss.LifecycleVersionExpiration{ | ||
NoncurrentDays: markDeletionAfterDays, | ||
} | ||
versionTransitionRule := oss.LifecycleRule{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might it be good idea to have a 1-2-1 structural mapping between wfv1.LifecycleRule
and oss.LifecycleRule
? that way you could have copy the fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intentional so it's easier for users to just specify the number of days. This already supports the most popular use cases to save cloud storage expenses for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be extended to more complex cases easily?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be unnecessary to support more complex cases at this point. This should cover most of the common use cases when handling 0SS objects created by Argo. Other complicated usages such as tagging and matching on objects should be done using OSS CLI or SDK (we could easily introduce new fields in OSSLifecycleRule
to support those as well when needed).
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan terrytangyuan@gmail.com
Checklist: