Fix for archivepruner to delete files only from subdir (#2456)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -41,7 +41,7 @@ type (
|
||||
Storage interface {
|
||||
getStorageType() StorageType
|
||||
dial() (stow.Location, error)
|
||||
// getSubDir() string
|
||||
getSubDir() string
|
||||
getContainerName() string
|
||||
getUploadFileName() (string, error)
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user