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
fix: putBucketLifecycle add ColdArchive and DeepColdArchive #1256
base: master
Are you sure you want to change the base?
Conversation
if (!['IA', 'Archive'].includes(rule.transition.storageClass)) | ||
throw new Error('StorageClass must be IA or Archive'); | ||
if (!['IA', 'Archive', 'ColdArchive', 'DeepColdArchive'].includes(rule.transition.storageClass)) | ||
throw new Error('StorageClass must be IA、Archive、ColdArchive、DeepColdArchive'); |
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.
存储类型的检查提个方法出来,transition和noncurrentVersionTransition都要用;这个error message多了一个空格,而且存储类型间应该是或的关系,要用or
test/config.js
Outdated
@@ -1,7 +1,7 @@ | |||
const { env } = process; | |||
|
|||
const config = module.exports; | |||
const USWEST = 'oss-us-west-1'; // ONCI=true Using the region of Silicon Valley in the United States would be faster | |||
const USWEST = 'oss-ap-southeast-1'; // ONCI=true Faster using oss-ap-outsoutheast-1 |
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.
代码注释拼写错误,且和签名的变量命名不一致,有办法同时支持美西和新加坡吗
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.
没有必要同时支持 美西和新加坡吧,要加的话,改动有点大
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.
我理解只是在这里加一个新的配置,库增加一个变量,在UT里增加一个bucket就好吧,后面直接用就行
test/node/bucket.test.js
Outdated
@@ -987,7 +1020,7 @@ describe('test/bucket.test.js', () => { | |||
]); | |||
assert(false); | |||
} catch (error) { | |||
assert(error.message.includes('IA or Archive')); | |||
assert(error.message.includes('IA、Archive')); |
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.
四种存储类型,这里就两个,而且是或的关系,上面的描述也要改吧
test/node/multiversion.test.js
Outdated
const { rules } = await store.getBucketLifecycle(bucket); | ||
const [ | ||
{ | ||
noncurrentVersionTransition: { noncurrentDays, storageClass } | ||
} | ||
] = rules; | ||
|
||
assert(noncurrentDays === '10' && storageClass === 'IA'); |
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.
这里确定是对的吗
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.
对的
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.
上面是四条呢,是不是都要检查一下
No description provided.