-
Notifications
You must be signed in to change notification settings - Fork 17
Support container deletion lock #558
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #558 +/- ##
==========================================
+ Coverage 63.37% 63.42% +0.05%
==========================================
Files 29 29
Lines 3279 3303 +24
==========================================
+ Hits 2078 2095 +17
- Misses 1195 1202 +7
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c35b324 to
8be2e26
Compare
8be2e26 to
36ea58a
Compare
98910b0 to
332b5e1
Compare
This auto-makes IR to deploy/update Container contract with supported locks nspcc-dev/neofs-contract#558. Signed-off-by: Leonard Lyubich <[email protected]>
Catch 'container is locked' exception added in nspcc-dev/neofs-contract#558 and respond with `CONTAINER_LOCKED` API status on it. Signed-off-by: Leonard Lyubich <[email protected]>
332b5e1 to
3384793
Compare
Attribute was introduced in nspcc-dev/neofs-api#357. It is now validated on creation, checked on deletion and can be set/reset in existing container. Closes #497. Signed-off-by: Leonard Lyubich <[email protected]>
3384793 to
a62baea
Compare
This auto-makes IR to deploy/update Container contract with supported locks nspcc-dev/neofs-contract#558. This also makes IR to accept containers with lock attribute. Signed-off-by: Leonard Lyubich <[email protected]>
Catch 'container is locked' exception added in nspcc-dev/neofs-contract#558 and respond with `CONTAINER_LOCKED` API status on it. Signed-off-by: Leonard Lyubich <[email protected]>
contracts/container/contract.go
Outdated
|
|
||
| switch name { | ||
| case corsAttributeName: | ||
| case corsAttributeName, lockAttributeName: |
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.
This attribute can't be removed/changed that easy. Treat it like a LOCK object, the lock can be extended, but not shortened or deleted, that's the purpose of it.
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.
make it disposable?
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.
After it expires it can be deleted, but not sooner than that.
| for i := range cnr.Attributes { | ||
| switch cnr.Attributes[i].Key { | ||
| case lockAttributeName: | ||
| if std.Atoi10(cnr.Attributes[i].Value) <= 0 { |
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.
also thinking of check against current time
Signed-off-by: Leonard Lyubich <[email protected]>
566b49f to
e01c939
Compare
also wanna w8 4 #555 and provide option to set lock attribute the same way