Skip to content

Commit

Permalink
HDDS-12073. Don't show Source Bucket and Volume if null in DU metadata (
Browse files Browse the repository at this point in the history
  • Loading branch information
devabhishekpal authored Feb 3, 2025
1 parent 8cbf459 commit cd996f0
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ const DUMetadata: React.FC<MetadataProps> = ({
*/
const selectedInfoKeys = [
'bucketName', 'bucketLayout', 'encInfo', 'fileName', 'keyName',
'name', 'owner', 'sourceBucket', 'sourceVolume', 'storageType',
'usedNamespace', 'volumeName', 'volume'
'name', 'owner', 'storageType', 'usedNamespace', 'volumeName', 'volume'
] as const;
const objectInfo: ObjectInfo = summaryResponse.objectInfo ?? {};

Expand All @@ -155,6 +154,22 @@ const DUMetadata: React.FC<MetadataProps> = ({
}
});

// Source Volume and Source Bucket are present for linked buckets and volumes.
// If it is not linked it will be null and should not be shown
if (objectInfo?.sourceBucket !== undefined && objectInfo?.sourceBucket !== null) {
data.push({
key: 'Source Bucket',
value: objectInfo.sourceBucket
});
}

if(objectInfo?.sourceVolume !== undefined && objectInfo?.sourceVolume !== null) {
data.push({
key: 'Source Volume',
value: objectInfo.sourceVolume
});
}

if (objectInfo?.creationTime !== undefined && objectInfo?.creationTime !== -1) {
data.push({
key: 'Creation Time',
Expand Down

0 comments on commit cd996f0

Please sign in to comment.