Skip to content

Commit c9af126

Browse files
committed
fix: s3 in cluster scheme
1 parent af6f648 commit c9af126

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api-server/services/organization.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ func (s *organizationService) GetS3Config(ctx context.Context, org *models.Organ
416416
scheme = "https"
417417
}
418418

419+
inClusterScheme := scheme
420+
419421
if endpointInCluster == "" {
420422
svcCli := cliset.CoreV1().Services(consts.KubeNamespaceYataiComponents)
421423
var svc *corev1.Service
@@ -430,14 +432,15 @@ func (s *organizationService) GetS3Config(ctx context.Context, org *models.Organ
430432
endpointInCluster = endpoint
431433
} else {
432434
endpointInCluster = fmt.Sprintf("%s.%s", svc.Name, svc.Namespace)
435+
inClusterScheme = "http"
433436
}
434437
}
435438

436439
conf = &S3Config{
437440
Endpoint: endpoint,
438441
EndpointInCluster: endpointInCluster,
439442
EndpointWithScheme: fmt.Sprintf("%s://%s", scheme, endpoint),
440-
EndpointWithSchemeInCluster: fmt.Sprintf("%s://%s", scheme, endpointInCluster),
443+
EndpointWithSchemeInCluster: fmt.Sprintf("%s://%s", inClusterScheme, endpointInCluster),
441444
AccessKey: string(accessKey),
442445
SecretKey: string(secretKey),
443446
Secure: secure,

0 commit comments

Comments
 (0)