Skip to content

Commit

Permalink
Merge pull request #57 from pratikkumar-mohite/pm/issue-56
Browse files Browse the repository at this point in the history
Issue 56 - delete suspended objects
  • Loading branch information
pratikkumar-mohite authored Nov 23, 2024
2 parents 590a607 + d205b7e commit 05a9790
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/aws/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"strings"

log "github.com/sirupsen/logrus"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3"
log "github.com/sirupsen/logrus"
)

func (c *S3Client) GetS3Bucket(bucket_name string) string {
Expand Down Expand Up @@ -97,7 +97,8 @@ func (c *S3Client) GetS3BucketObjects() []S3BucketObject {
log.Fatalf("Unable to list objects, %v" + err.Error())
}
objects := make([]S3BucketObject, len(output.Contents))
if c.checkVersioningStatus(bucket) == "Enabled" {
version_status := c.checkVersioningStatus(bucket)
if version_status == "Enabled" || version_status == "Suspended" {
log.Infof("Versioning is enabled for bucket %s\n", bucket)
return c.listObjectVersions(&bucket)
}
Expand Down

0 comments on commit 05a9790

Please sign in to comment.