소스 검색

PR feedback, log for storage test

Signed-off-by: nickcurie <ncurie@kubecost.com>
nickcurie 2 년 전
부모
커밋
27009cf218
2개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      pkg/storage/s3storage.go
  2. 3 0
      pkg/storage/storage.go

+ 2 - 2
pkg/storage/s3storage.go

@@ -357,7 +357,7 @@ func (s3 *S3Storage) Read(name string) ([]byte, error) {
 // Exists checks if the given object exists.
 func (s3 *S3Storage) Exists(name string) (bool, error) {
 	name = trimLeading(name)
-	//log.Tracef("S3Storage::Exists(%s)", name)
+	log.Tracef("S3Storage::Exists(%s)", name)
 
 	ctx := context.Background()
 
@@ -410,7 +410,7 @@ func (s3 *S3Storage) Write(name string, data []byte) error {
 func (s3 *S3Storage) Stat(name string) (*StorageInfo, error) {
 	name = trimLeading(name)
 
-	//log.Tracef("S3Storage::Stat(%s)", name)
+	log.Tracef("S3Storage::Stat(%s)", name)
 	ctx := context.Background()
 
 	objInfo, err := s3.client.StatObject(ctx, s3.name, name, minio.StatObjectOptions{})

+ 3 - 0
pkg/storage/storage.go

@@ -4,6 +4,7 @@ import (
 	"os"
 	"time"
 
+	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/pkg/errors"
 )
 
@@ -63,6 +64,8 @@ func Validate(storage Storage) error {
 	const testPath = "tmp/test.txt"
 	const testContent = "test"
 
+	log.Debug("validating storage")
+
 	// attempt to read a path
 	_, err := storage.Exists(testPath)
 	if err != nil {