Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: logs container using tmp dir #5708

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading