Skip to content

Commit

Permalink
Infer secure based on the scheme provided.
Browse files Browse the repository at this point in the history
Signed-off-by: Achyut Madhusudan <amadhusu@redhat.com>
  • Loading branch information
Achyut Madhusudan committed Jul 11, 2023
1 parent 543be92 commit 8b4b5d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions controllers/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const (
MinioHostPrefix = "minio"
MinioPort = "9000"
MinioScheme = "http"
MinioSecure = false
MinioDefaultBucket = "mlpipeline"
MinioPVCSize = "10Gi"

Expand Down
11 changes: 9 additions & 2 deletions controllers/dspipeline_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ type DBConnection struct {
type ObjectStorageConnection struct {
Bucket string
CredentialsSecret *dspa.S3CredentialSecret
Secure bool
Host string
Port string
Scheme string
Secure bool
Endpoint string // scheme://host:port
AccessKeyID string
SecretAccessKey string
Expand Down Expand Up @@ -235,7 +235,11 @@ func (p *DSPAParams) SetupObjectParams(ctx context.Context, dsp *dspa.DataScienc
p.ObjectStorageConnection.Bucket = dsp.Spec.ObjectStorage.ExternalStorage.Bucket
p.ObjectStorageConnection.Host = dsp.Spec.ObjectStorage.ExternalStorage.Host
p.ObjectStorageConnection.Scheme = dsp.Spec.ObjectStorage.ExternalStorage.Scheme
p.ObjectStorageConnection.Secure = dsp.Spec.ObjectStorage.ExternalStorage.Secure
if p.ObjectStorageConnection.Scheme == "https" {
p.ObjectStorageConnection.Secure = true
} else {
p.ObjectStorageConnection.Secure = false
}
// Port can be empty, which is fine.
p.ObjectStorageConnection.Port = dsp.Spec.ObjectStorage.ExternalStorage.Port
customCreds = dsp.Spec.ObjectStorage.ExternalStorage.S3CredentialSecret
Expand Down Expand Up @@ -265,6 +269,8 @@ func (p *DSPAParams) SetupObjectParams(ctx context.Context, dsp *dspa.DataScienc
)
p.ObjectStorageConnection.Port = config.MinioPort
p.ObjectStorageConnection.Scheme = config.MinioScheme
p.ObjectStorageConnection.Secure = config.MinioSecure

if p.Minio.S3CredentialSecret != nil {
customCreds = p.Minio.S3CredentialSecret
}
Expand Down Expand Up @@ -343,6 +349,7 @@ func (p *DSPAParams) SetupObjectParams(ctx context.Context, dsp *dspa.DataScienc
}

return nil

}

func (p *DSPAParams) SetupMLMD(ctx context.Context, dsp *dspa.DataSciencePipelinesApplication, client client.Client, log logr.Logger) error {
Expand Down

0 comments on commit 8b4b5d1

Please sign in to comment.