forked from TrueCloudLab/distribution
Support all S3 instant retrieval storage classes
Signed-off-by: ddelange <14880945+ddelange@users.noreply.github.com>
This commit is contained in:
parent
d2c9f72c6b
commit
fb937deabf
1 changed files with 34 additions and 5 deletions
|
@ -308,16 +308,45 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) {
|
||||||
if storageClassParam != nil {
|
if storageClassParam != nil {
|
||||||
storageClassString, ok := storageClassParam.(string)
|
storageClassString, ok := storageClassParam.(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("the storageclass parameter must be one of %v, %v invalid",
|
return nil, fmt.Errorf(
|
||||||
[]string{s3.StorageClassStandard, s3.StorageClassReducedRedundancy}, storageClassParam)
|
"the storageclass parameter must be one of %v, %v invalid",
|
||||||
|
[]string{
|
||||||
|
noStorageClass,
|
||||||
|
s3.StorageClassStandard,
|
||||||
|
s3.StorageClassReducedRedundancy,
|
||||||
|
s3.StorageClassStandardIa,
|
||||||
|
s3.StorageClassOnezoneIa,
|
||||||
|
s3.StorageClassIntelligentTiering,
|
||||||
|
s3.StorageClassOutposts,
|
||||||
|
s3.StorageClassGlacierIr,
|
||||||
|
},
|
||||||
|
storageClassParam,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
// All valid storage class parameters are UPPERCASE, so be a bit more flexible here
|
// All valid storage class parameters are UPPERCASE, so be a bit more flexible here
|
||||||
storageClassString = strings.ToUpper(storageClassString)
|
storageClassString = strings.ToUpper(storageClassString)
|
||||||
if storageClassString != noStorageClass &&
|
if storageClassString != noStorageClass &&
|
||||||
storageClassString != s3.StorageClassStandard &&
|
storageClassString != s3.StorageClassStandard &&
|
||||||
storageClassString != s3.StorageClassReducedRedundancy {
|
storageClassString != s3.StorageClassReducedRedundancy &&
|
||||||
return nil, fmt.Errorf("the storageclass parameter must be one of %v, %v invalid",
|
storageClassString != s3.StorageClassStandardIa &&
|
||||||
[]string{noStorageClass, s3.StorageClassStandard, s3.StorageClassReducedRedundancy}, storageClassParam)
|
storageClassString != s3.StorageClassOnezoneIa &&
|
||||||
|
storageClassString != s3.StorageClassIntelligentTiering &&
|
||||||
|
storageClassString != s3.StorageClassOutposts &&
|
||||||
|
storageClassString != s3.StorageClassGlacierIr {
|
||||||
|
return nil, fmt.Errorf(
|
||||||
|
"the storageclass parameter must be one of %v, %v invalid",
|
||||||
|
[]string{
|
||||||
|
noStorageClass,
|
||||||
|
s3.StorageClassStandard,
|
||||||
|
s3.StorageClassReducedRedundancy,
|
||||||
|
s3.StorageClassStandardIa,
|
||||||
|
s3.StorageClassOnezoneIa,
|
||||||
|
s3.StorageClassIntelligentTiering,
|
||||||
|
s3.StorageClassOutposts,
|
||||||
|
s3.StorageClassGlacierIr,
|
||||||
|
},
|
||||||
|
storageClassParam,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
storageClass = storageClassString
|
storageClass = storageClassString
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue