allow empty buckets listed with mc ls -r (#3476)
This commit is contained in:
@@ -199,6 +199,7 @@ func mainAdminHeal(ctx *cli.Context) error {
|
||||
fatalIf(err.Trace(clnt.GetURL().String()), "Unable to create client for URL ", aliasedURL)
|
||||
return nil
|
||||
}
|
||||
|
||||
for content := range clnt.List(globalContext, ListOptions{IsRecursive: false, ShowDir: DirNone}) {
|
||||
if content.Err != nil {
|
||||
fatalIf(content.Err.Trace(clnt.GetURL().String()), "Unable to heal bucket `"+bucket+"`.")
|
||||
|
||||
+1
-1
@@ -249,7 +249,7 @@ func doFind(ctxCtx context.Context, ctx *findContext) error {
|
||||
var prevKeyName string
|
||||
|
||||
// iterate over all content which is within the given directory
|
||||
for content := range ctx.clnt.List(globalContext, ListOptions{IsRecursive: true, ShowDir: DirNone}) {
|
||||
for content := range ctx.clnt.List(globalContext, ListOptions{IsRecursive: true, ShowDir: DirFirst}) {
|
||||
if content.Err != nil {
|
||||
switch content.Err.ToGoError().(type) {
|
||||
// handle this specifically for filesystem related errors.
|
||||
|
||||
@@ -195,7 +195,7 @@ func doList(ctx context.Context, clnt Client, isRecursive, isIncomplete bool, ti
|
||||
TimeRef: timeRef,
|
||||
WithOlderVersions: withOlderVersions || !timeRef.IsZero(),
|
||||
WithDeleteMarkers: true,
|
||||
ShowDir: DirNone,
|
||||
ShowDir: DirFirst,
|
||||
}) {
|
||||
if content.Err != nil {
|
||||
switch content.Err.ToGoError().(type) {
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ func doTree(ctx context.Context, url string, timeRef time.Time, level int, leaf
|
||||
return nil
|
||||
}
|
||||
|
||||
for content := range clnt.List(ctx, ListOptions{IsRecursive: false, TimeRef: timeRef, ShowDir: DirNone}) {
|
||||
for content := range clnt.List(ctx, ListOptions{IsRecursive: false, TimeRef: timeRef, ShowDir: DirFirst}) {
|
||||
if content.Err != nil {
|
||||
errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to tree.")
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user