update s3 endpoint handling

virtual host extracts bucket name from endpoint environment variable;
path uses fixed bucket name
This commit is contained in:
Michael Hohn
2025-05-13 10:47:54 -07:00
committed by =Michael Hohn
parent bde8ac2db7
commit 5bdbd60cc5
5 changed files with 62 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ import (
// Restrict the keys / values for ArtifactLocation and centralize the common ones
// here
const (
var (
AF_BUCKETNAME_RESULTS = "mrvabucket"
AF_BUCKETNAME_PACKS = "mrvabucket"
)

View File

@@ -18,11 +18,11 @@ type MinIOArtifactStore struct {
client *minio.Client
}
func NewMinIOArtifactStore(endpoint, id, secret string) (*MinIOArtifactStore, error) {
func NewMinIOArtifactStore(endpoint, id, secret string, lookup minio.BucketLookupType) (*MinIOArtifactStore, error) {
minioClient, err := minio.New(endpoint, &minio.Options{
Creds: credentials.NewStaticV4(id, secret, ""),
Secure: false,
BucketLookup: minio.BucketLookupDNS, // Enable virtual-host-style addressing
BucketLookup: lookup,
})
if err != nil {
return nil, err