Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow blank port for minio client to work with S3 (kubeflow#2996)
Background --- As of current, supplying a minioServiceHost of `s3.amazonaws.com` with any port incurs an error. Per the results of: ``` testBucket := func(hostPort string) error { client, _ := minio.New(hostPort, accessKey, secretKey, false) _, err := client.BucketExists(bucket) return err } for _, endpoint := range []string{ "s3.amazonaws.com:443", "s3.amazonaws.com:80", "s3.amazonaws.com:", "s3.amazonaws.com", } { fmt.Printf("Endpoint: %s, Error: %v\n", endpoint, testBucket(endpoint)) } ``` ``` Endpoint: s3.amazonaws.com:443, Error: Get http://s3.amazonaws.com:443/kflow-test/?location=: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x00\x00\x00\x02\x01\x00" Endpoint: s3.amazonaws.com:80, Error: Head http://s3.amazonaws.com/kflow-test/: 301 response missing Location header Endpoint: s3.amazonaws.com:, Error: Head http://s3.amazonaws.com/kflow-test/: 301 response missing Location header Endpoint: s3.amazonaws.com, Error: <nil> ``` Only the connection without a port specified works. This change allows passing a blank port to support this.
- Loading branch information