Repository navigation
Accept GLACIER/DEEP_ARCHIVE as cold locations, advertise the Veeam archive tier #6329
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: development/9.5
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ const versionIdUtils = versioning.VersionID; | |
| const monitoring = require('../utilities/monitoringHandler'); | ||
| const { generateToken, decryptToken } = require('../api/apiUtils/object/continueToken'); | ||
| const { parseAttributesHeaders, buildAttributesXml } = require('./apiUtils/object/objectAttributes'); | ||
| const { formatStorageClass } = require('./apiUtils/object/storageClass'); | ||
|
|
||
| const OPTIONAL_ATTRIBUTES = new Set(['RestoreStatus']); | ||
|
|
||
|
|
@@ -158,7 +159,10 @@ function processVersions(bucketName, listParams, list) { | |
| buildAttributesXml(v, v.userMetadata, listParams.optionalAttributes, xml); | ||
| } | ||
|
|
||
| xml.push(`<StorageClass>${v.StorageClass}</StorageClass>`, v.IsDeleteMarker ? '</DeleteMarker>' : '</Version>'); | ||
| xml.push( | ||
| `<StorageClass>${formatStorageClass(v.StorageClass)}</StorageClass>`, | ||
| v.IsDeleteMarker ? '</DeleteMarker>' : '</Version>', | ||
| ); | ||
| }); | ||
|
|
||
| list.CommonPrefixes.forEach(item => { | ||
|
|
@@ -242,7 +246,7 @@ function processMasterVersions(bucketName, listParams, list) { | |
|
|
||
| buildAttributesXml(v, v.userMetadata, listParams.optionalAttributes, xml); | ||
|
|
||
| return xml.push(`<StorageClass>${v.StorageClass}</StorageClass>`, '</Contents>'); | ||
| return xml.push(`<StorageClass>${formatStorageClass(v.StorageClass)}</StorageClass>`, '</Contents>'); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ListParts was missed:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, fixed: ListParts now goes through |
||
| }); | ||
| list.CommonPrefixes.forEach(item => { | ||
| xml.push(`<CommonPrefixes><Prefix>${escapeXmlFn(item)}</Prefix></CommonPrefixes>`); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,13 @@ | ||
| const joi = require('joi'); | ||
| const { errors, errorInstances } = require('@scality/arsenal'); | ||
| const { config } = require('../../../Config'); | ||
| const { isColdStorageClass } = require('../../../api/apiUtils/object/storageClass'); | ||
|
|
||
| // Veeam writes to the archive tier with the GLACIER storage class, which needs direct-to-cold | ||
| // writes and a cold location of that name | ||
| function supportsOnPremArchiveTier() { | ||
| return !!(config.enableDirectToCold && isColdStorageClass('glacier')); | ||
| } | ||
|
|
||
| // Allow supporting any version of the protocol | ||
| const systemSchemasPerVersion = { | ||
|
|
@@ -14,6 +22,7 @@ const systemSchemasPerVersion = { | |
| CapacityInfo: joi.boolean().required(), | ||
| UploadSessions: joi.boolean().required(), | ||
| IAMSTS: joi.boolean().default(false), | ||
| EnableOnPremArchiveTier: joi.boolean().default(supportsOnPremArchiveTier), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This default is computed once, when |
||
| }) | ||
| .required(), | ||
| APIEndpoints: joi.object({ | ||
|
|
@@ -43,6 +52,7 @@ const systemSchemasPerVersion = { | |
| * <CapacityInfo>true</CapacityInfo> | ||
| * <UploadSessions>true</UploadSessions> | ||
| * <IAMSTS>true</IAMSTS> | ||
| * <EnableOnPremArchiveTier>true</EnableOnPremArchiveTier> | ||
| * </ProtocolCapabilities> | ||
| * <APIEndpoints> | ||
| * <IAMEndpoint>https://storage.acme.local/iam/endpoint</IAMEndpoint> | ||
|
|
||
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.
Bucket policies are checked after this rewrite (
objectPut/objectCopy/initiateMultipartUploadcallvalidateStorageClassbeforestandardMetadataValidateBucket(AndObj), andcheckBucketPolicybuilds itsRequestContextfromrequest.headers). So bucket policies seeglacierwhile IAM sawGLACIER. A bucket policyDenywithStringEquals s3:x-amz-storage-class: GLACIERwill never match, so the write goes through. That doesn't fit "policies apply to the storage class as sent by the client". Keep the original header and pass the resolved location separately, e.g. return it or store it onrequest, instead of mutatingheaders.