mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-07 18:20:36 +00:00
feat: fix for s3 cache from operator
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
4
pkg/cache/cache.go
vendored
4
pkg/cache/cache.go
vendored
@@ -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)
|
||||
|
5
pkg/cache/s3_based.go
vendored
5
pkg/cache/s3_based.go
vendored
@@ -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{
|
||||
|
Reference in New Issue
Block a user