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
|
return id.String(), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ls localStorage) getSubDir() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (ls localStorage) getContainerName() string {
|
func (ls localStorage) getContainerName() string {
|
||||||
return ls.containerName
|
return ls.containerName
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ func (ss s3Storage) getContainerName() string {
|
|||||||
return ss.bucketName
|
return ss.bucketName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ss s3Storage) getSubDir() string {
|
||||||
|
return ss.subDir
|
||||||
|
}
|
||||||
|
|
||||||
func (ss s3Storage) getUploadFileName() (string, error) {
|
func (ss s3Storage) getUploadFileName() (string, error) {
|
||||||
id, err := uuid.NewV4()
|
id, err := uuid.NewV4()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ type (
|
|||||||
Storage interface {
|
Storage interface {
|
||||||
getStorageType() StorageType
|
getStorageType() StorageType
|
||||||
dial() (stow.Location, error)
|
dial() (stow.Location, error)
|
||||||
// getSubDir() string
|
getSubDir() string
|
||||||
getContainerName() string
|
getContainerName() string
|
||||||
getUploadFileName() (string, error)
|
getUploadFileName() (string, error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ func (client *StowClient) getItemIDsWithFilter(filterFunc filter, filterFuncPara
|
|||||||
archiveIDList := make([]string, 0)
|
archiveIDList := make([]string, 0)
|
||||||
|
|
||||||
for {
|
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 {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error getting items from container")
|
return nil, errors.Wrap(err, "error getting items from container")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user