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

Commit 398e96f

Browse files
committed
Add ability to change port used to communicate with s3
1 parent 1783449 commit 398e96f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

operator/controllers/scan_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,14 +753,18 @@ func (r *ScanReconciler) SetupWithManager(mgr ctrl.Manager) error {
753753
endpoint := os.Getenv("S3_ENDPOINT")
754754
accessKeyID := os.Getenv("S3_ACCESS_KEY")
755755
secretAccessKey := os.Getenv("S3_SECRET_KEY")
756+
port := "443"
757+
if os.Getenv("S3_PORT") != "" {
758+
port = os.Getenv("S3_PORT")
759+
}
756760
useSSL := true
757761
// Only deactivate useSSL when explicitly set to false
758762
if os.Getenv("S3_SECRET_KEY") == "false" {
759763
useSSL = false
760764
}
761765

762766
// Initialize minio client object.
763-
minioClient, err := minio.New(endpoint, accessKeyID, secretAccessKey, useSSL)
767+
minioClient, err := minio.New(fmt.Sprintf("%s:%s", endpoint, port), accessKeyID, secretAccessKey, useSSL)
764768
if err != nil {
765769
r.Log.Error(err, "Could not create minio client to communicate with s3 or compatible storage provider")
766770
panic(err)

0 commit comments

Comments
 (0)