Skip to content

Commit 3a8afa2

Browse files
committed
Misc cleanup
1 parent fc06dae commit 3a8afa2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cli/cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var _versionCmd = &cobra.Command{
4040
Run: func(cmd *cobra.Command, args []string) {
4141
envName, err := getEnvFromFlag(_flagVersionEnv)
4242

43-
if err != nil || envName == "" {
43+
if err != nil {
4444
telemetry.Event("cli.version")
4545
fmt.Println("cli version: " + consts.CortexVersion)
4646
return

pkg/lib/aws/s3.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -706,10 +706,6 @@ func (c *Client) DeleteS3Dir(bucket string, s3Dir string, continueIfFailure bool
706706

707707
func (c *Client) DeleteS3Prefix(bucket string, prefix string, continueIfFailure bool) error {
708708
err := c.S3BatchIterator(bucket, prefix, true, nil, func(objects []*s3.Object) (bool, error) {
709-
if len(objects) == 0 {
710-
return true, nil
711-
}
712-
713709
deleteObjects := make([]*s3.ObjectIdentifier, len(objects))
714710
for i, object := range objects {
715711
deleteObjects[i] = &s3.ObjectIdentifier{Key: object.Key}
@@ -814,6 +810,10 @@ func (c *Client) S3BatchIterator(bucket string, prefix string, includeDirObjects
814810
objects = filtered
815811
}
816812

813+
if len(objects) == 0 {
814+
return true
815+
}
816+
817817
shouldContinue, newSubErr := fn(objects)
818818
if newSubErr != nil {
819819
subErr = newSubErr

0 commit comments

Comments
 (0)