Fix for archivepruner to delete files only from subdir (#2456)

This commit is contained in:
Ankit Chawla
2022-06-13 12:35:49 +05:30
committed by GitHub
parent 5d010fe1fa
commit fa3347077a
4 changed files with 10 additions and 2 deletions
+4
View File
@@ -42,6 +42,10 @@ func (ls localStorage) getUploadFileName() (string, error) {
return id.String(), err
}
func (ls localStorage) getSubDir() string {
return ""
}
func (ls localStorage) getContainerName() string {
return ls.containerName
}
+4
View File
@@ -49,6 +49,10 @@ func (ss s3Storage) getContainerName() string {
return ss.bucketName
}
func (ss s3Storage) getSubDir() string {
return ss.subDir
}
func (ss s3Storage) getUploadFileName() (string, error) {
id, err := uuid.NewV4()
if err != nil {
+1 -1
View File
@@ -41,7 +41,7 @@ type (
Storage interface {
getStorageType() StorageType
dial() (stow.Location, error)
// getSubDir() string
getSubDir() string
getContainerName() string
getUploadFileName() (string, error)
}
+1 -1
View File
@@ -206,7 +206,7 @@ func (client *StowClient) getItemIDsWithFilter(filterFunc filter, filterFuncPara
archiveIDList := make([]string, 0)
for {
items, cursor, err = client.container.Items(stow.NoPrefix, cursor, PaginationSize)
items, cursor, err = client.container.Items(client.config.storage.getSubDir(), cursor, PaginationSize)
if err != nil {
return nil, errors.Wrap(err, "error getting items from container")
}