Skip to content

Commit

Permalink
fix: logs container using tmp dir instead of /data (#5708)
Browse files Browse the repository at this point in the history
* fix: logs container using tmp dir

* fix: remove chmod

* fix: remove data directory

* fix: remove data directory
  • Loading branch information
exu committed Jul 31, 2024
1 parent 5dfa07b commit 88ce406
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 0 additions & 3 deletions build/logs-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ RUN apk --no-cache --update add ca-certificates && (rm -rf /var/cache/apk/* || 0

WORKDIR /root/

RUN mkdir /data
RUN chown -R 1001:0 /data

COPY testkube-logs-server /bin/app
USER 1001
EXPOSE 8088
Expand Down
9 changes: 5 additions & 4 deletions pkg/logs/adapter/minio_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import (
minioconnecter "github.com/kubeshop/testkube/pkg/storage/minio"
)

// DefaultDataDir is a default directory where logs are stored (logs-service Dockerfile creates this directory)
const DefaultDataDir = "/data"

var _ Adapter = &MinioV2Adapter{}

// NewMinioV2Adapter creates new MinioV2Adapter which will send data to local MinIO bucket
func NewMinioV2Adapter(endpoint, accessKeyID, secretAccessKey, region, token, bucket string, ssl, skipVerify bool, certFile, keyFile, caFile string) (*MinioV2Adapter, error) {
dir, err := os.MkdirTemp("", "minio")
if err != nil {
return nil, err
}
ctx := context.Background()
opts := minioconnecter.GetTLSOptions(ssl, skipVerify, certFile, keyFile, caFile)
c := &MinioV2Adapter{
Expand All @@ -30,7 +31,7 @@ func NewMinioV2Adapter(endpoint, accessKeyID, secretAccessKey, region, token, bu
bucket: bucket,
region: region,
files: make(map[string]*os.File),
path: DefaultDataDir,
path: dir,
}
minioClient, err := c.minioConnecter.GetClient()
if err != nil {
Expand Down

0 comments on commit 88ce406

Please sign in to comment.