Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit fab47d1

Browse files
committed
Only set port when it is acutally set
Automatic 443 port clashes with minio client detection of automatic feature flag setting for different cloud environments
1 parent 0afc94a commit fab47d1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

operator/controllers/execution/scan_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,8 @@ func (r *ScanReconciler) initS3Connection() *minio.Client {
898898
endpoint := os.Getenv("S3_ENDPOINT")
899899
accessKeyID := os.Getenv("S3_ACCESS_KEY")
900900
secretAccessKey := os.Getenv("S3_SECRET_KEY")
901-
port := "443"
902901
if os.Getenv("S3_PORT") != "" {
903-
port = os.Getenv("S3_PORT")
902+
endpoint = fmt.Sprintf("%s:%s", endpoint, os.Getenv("S3_PORT"))
904903
}
905904
// Only deactivate useSSL when explicitly set to false
906905
useSSL := true
@@ -909,7 +908,7 @@ func (r *ScanReconciler) initS3Connection() *minio.Client {
909908
}
910909

911910
// Initialize minio client object.
912-
minioClient, err := minio.New(fmt.Sprintf("%s:%s", endpoint, port), accessKeyID, secretAccessKey, useSSL)
911+
minioClient, err := minio.New(endpoint, accessKeyID, secretAccessKey, useSSL)
913912
if err != nil {
914913
r.Log.Error(err, "Could not create minio client to communicate with s3 or compatible storage provider")
915914
panic(err)

0 commit comments

Comments
 (0)