Skip to content

Commit

Permalink
feat: fix for s3 cache from operator
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
  • Loading branch information
AlexsJones committed Jun 15, 2023
1 parent 1bc0f42 commit f6db6ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ func AddRemoteCache(bucketName string, region string) error {
if err != nil {
return err
}
if cacheInfo.BucketName != "" {
return errors.New("Error: a cache is already configured, please remove it first")
}

cacheInfo.BucketName = bucketName
cacheInfo.Region = region
viper.Set("cache", cacheInfo)
Expand Down
5 changes: 1 addition & 4 deletions pkg/cache/s3_based.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,9 @@ func NewS3Cache(nocache bool) ICache {
Bucket: aws.String(cache.BucketName),
})
if err != nil {
_, err = s.CreateBucket(&s3.CreateBucketInput{
_, _ = s.CreateBucket(&s3.CreateBucketInput{
Bucket: aws.String(cache.BucketName),
})
if err != nil {
panic(err)
}
}

return &S3Cache{
Expand Down

0 comments on commit f6db6ce

Please sign in to comment.