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

Sandbox for testing TKC-2564 - just for testing - original PR: #5858 #5859

Closed
wants to merge 3 commits into from
Closed
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
13 changes: 12 additions & 1 deletion pkg/storage/minio/minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ var _ storage.Client = (*Client)(nil)
// ErrArtifactsNotFound contains error for not existing artifacts
var ErrArtifactsNotFound = errors.New("Execution doesn't have any artifacts associated with it")

// absMinPartSize - absolute minimum part size (5 MiB) below which
// a part in a multipart upload may not be uploaded.
const absMinPartSize = 1024 * 1024 * 5

// Client for managing MinIO storage server
type Client struct {
region string
Expand Down Expand Up @@ -490,8 +494,15 @@ func (c *Client) uploadFile(ctx context.Context, bucket, bucketFolder, filePath
filePath = strings.Trim(bucketFolder, "/") + "/" + filePath
}

var partSize uint64
if objectSize == -1 {
partSize = absMinPartSize
}

c.Log.Debugw("saving object in minio", "file", filePath, "bucket", bucket)
_, err = c.minioClient.PutObject(ctx, bucket, filePath, reader, objectSize, minio.PutObjectOptions{ContentType: "application/octet-stream"})
_, err = c.minioClient.PutObject(ctx, bucket, filePath, reader, objectSize, minio.PutObjectOptions{
ContentType: "application/octet-stream",
PartSize: partSize})
if err != nil {
return fmt.Errorf("minio saving file (%s) put object error: %w", filePath, err)
}
Expand Down
37 changes: 37 additions & 0 deletions test/postman/hello-postman.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"info": {
"_postman_id": "2c19e161-6009-4237-8643-9c6df5b0c596",
"name": "hello-postman",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "549544"
},
"item": [
{
"name": "website-active-check",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function(){",
" pm.response.to.have.status(200);",
"})"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{URL}}",
"host": [
"{{URL}}"
]
}
},
"response": []
}
]
}
Loading