diff --git a/core/Command/Info/File.php b/core/Command/Info/File.php index 287bd0e29cbbe..a20afb508fa18 100644 --- a/core/Command/Info/File.php +++ b/core/Command/Info/File.php @@ -8,6 +8,7 @@ namespace OC\Core\Command\Info; use OC\Files\ObjectStore\ObjectStoreStorage; +use OC\Files\ObjectStore\PrimaryObjectStoreConfig; use OC\Files\Storage\Wrapper\Encryption; use OC\Files\Storage\Wrapper\Wrapper; use OC\Files\View; @@ -36,6 +37,7 @@ public function __construct( IFactory $l10nFactory, private FileUtils $fileUtils, private \OC\Encryption\Util $encryptionUtil, + private PrimaryObjectStoreConfig $objectStoreConfig, ) { $this->l10n = $l10nFactory->get('core'); parent::__construct(); @@ -145,6 +147,25 @@ private function outputStorageDetails(IMountPoint $mountPoint, Node $node, Input $parts = explode(':', $objectStoreId); /** @var string $bucket */ $bucket = array_pop($parts); + if ($this->objectStoreConfig->hasMultipleObjectStorages()) { + $configs = $this->objectStoreConfig->getObjectStoreConfigs(); + foreach ($configs as $instance => $config) { + if (is_array($config)) { + if ($config['arguments']['multibucket']) { + if (str_starts_with($bucket, $config['arguments']['bucket'])) { + $postfix = substr($bucket, strlen($config['arguments']['bucket'])); + if (is_numeric($postfix)) { + $output->writeln(' object store instance: ' . $instance); + } + } + } else { + if ($config['arguments']['bucket'] === $bucket) { + $output->writeln(' object store instance: ' . $instance); + } + } + } + } + } $output->writeln(' bucket: ' . $bucket); if ($node instanceof \OC\Files\Node\File) { $output->writeln(' object id: ' . $storage->getURN($node->getId()));