Skip to content

Commit

Permalink
fix: logs container using tmp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
exu committed Jul 31, 2024
1 parent f98e37b commit e1a13ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build/logs-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ WORKDIR /root/

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


COPY testkube-logs-server /bin/app
USER 1001
Expand Down
6 changes: 5 additions & 1 deletion pkg/logs/adapter/minio_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ 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 +34,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 e1a13ff

Please sign in to comment.