Skip to content

Commit

Permalink
fix: objectstore refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrapCodes committed Mar 22, 2022
1 parent 763d42c commit 12a151d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions tekton-catalog/objectstore/pkg/writer/objectstorelogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ func (l *Logger) load(o ObjectStoreConfig) error {
WithS3ForcePathStyle(o.S3ForcePathStyle)

var sess = session.Must(session.NewSession())
l.Writer.DefaultBucketName = o.DefaultBucketName
l.Writer.client = s3.New(sess, conf)
l.Writer = &Writer{
DefaultBucketName: o.DefaultBucketName,
client: s3.New(sess, conf),
mu: sync.Mutex{},
}
input := &s3.CreateBucketInput{
Bucket: aws.String(o.DefaultBucketName),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ func initLogger(ctx context.Context, kubeClientSet kubernetes.Interface) *zap.Su
MaxSize: 1024 * 100, // TODO make it configurable via a configmap.
}
enabled, err := loadObjectStoreConfig(ctx, kubeClientSet, &loggerConfig)
if err == nil {
if err == nil && enabled {
err = objectStoreLogger.LoadDefaults(loggerConfig)
if err == nil {
_ = objectStoreLogger.Writer.CreateNewBucket(loggerConfig.DefaultBucketName)
} else {
logger.Errorf("error connecting to the object store, %v", err)
}
}
if err == nil && enabled {
Expand Down

0 comments on commit 12a151d

Please sign in to comment.