diff --git a/pkg/cmd/delete/edge_storage/bucket.go b/pkg/cmd/delete/edge_storage/bucket.go index c05498b20..50801ea54 100644 --- a/pkg/cmd/delete/edge_storage/bucket.go +++ b/pkg/cmd/delete/edge_storage/bucket.go @@ -57,7 +57,7 @@ func (b *bucket) runE(cmd *cobra.Command, _ []string) error { } logger.FInfo(b.factory.IOStreams.Out, "Delete all objects from bucket\n") logger.FInfo(b.factory.IOStreams.Out, "deleting objects...") - if err := deleteAllObjects(client, b, ctx, b.name, ""); err != nil { + if err := deleteAllObjects(client, ctx, b.name, ""); err != nil { return err } err := client.DeleteBucket(ctx, b.name) @@ -88,7 +88,7 @@ func (f *bucket) addFlags(flags *pflag.FlagSet) { flags.BoolP("help", "h", false, msg.FLAG_HELP_DELETE_BUCKET) } -func deleteAllObjects(client *api.Client, b *bucket, ctx context.Context, name, continuationToken string) error { +func deleteAllObjects(client *api.Client, ctx context.Context, name, continuationToken string) error { objects, err := client.ListObject(ctx, name, &contracts.ListOptions{ContinuationToken: continuationToken}) if err != nil { return err @@ -100,7 +100,7 @@ func deleteAllObjects(client *api.Client, b *bucket, ctx context.Context, name, return err } } - return deleteAllObjects(client, b, ctx, name, continuationToken) + return deleteAllObjects(client, ctx, name, continuationToken) } return nil }