@@ -27,6 +27,7 @@ import (
27
27
mf "github.com/manifestival/manifestival"
28
28
dspa "github.com/opendatahub-io/data-science-pipelines-operator/api/v1alpha1"
29
29
"github.com/opendatahub-io/data-science-pipelines-operator/controllers/config"
30
+ "github.com/opendatahub-io/data-science-pipelines-operator/controllers/util"
30
31
v1 "k8s.io/api/core/v1"
31
32
apierrs "k8s.io/apimachinery/pkg/api/errors"
32
33
"k8s.io/apimachinery/pkg/api/resource"
@@ -63,10 +64,10 @@ type DBConnection struct {
63
64
type ObjectStorageConnection struct {
64
65
Bucket string
65
66
CredentialsSecret * dspa.S3CredentialSecret
66
- Secure bool
67
67
Host string
68
68
Port string
69
69
Scheme string
70
+ Secure * bool
70
71
Endpoint string // scheme://host:port
71
72
AccessKeyID string
72
73
SecretAccessKey string
@@ -235,7 +236,17 @@ func (p *DSPAParams) SetupObjectParams(ctx context.Context, dsp *dspa.DataScienc
235
236
p .ObjectStorageConnection .Bucket = dsp .Spec .ObjectStorage .ExternalStorage .Bucket
236
237
p .ObjectStorageConnection .Host = dsp .Spec .ObjectStorage .ExternalStorage .Host
237
238
p .ObjectStorageConnection .Scheme = dsp .Spec .ObjectStorage .ExternalStorage .Scheme
238
- p .ObjectStorageConnection .Secure = dsp .Spec .ObjectStorage .ExternalStorage .Secure
239
+
240
+ if dsp .Spec .ObjectStorage .ExternalStorage .Secure == nil {
241
+ if p .ObjectStorageConnection .Scheme == "https" {
242
+ p .ObjectStorageConnection .Secure = util .BoolPointer (true )
243
+ } else {
244
+ p .ObjectStorageConnection .Secure = util .BoolPointer (false )
245
+ }
246
+ } else {
247
+ p .ObjectStorageConnection .Secure = dsp .Spec .ObjectStorage .ExternalStorage .Secure
248
+ }
249
+
239
250
// Port can be empty, which is fine.
240
251
p .ObjectStorageConnection .Port = dsp .Spec .ObjectStorage .ExternalStorage .Port
241
252
customCreds = dsp .Spec .ObjectStorage .ExternalStorage .S3CredentialSecret
@@ -265,6 +276,8 @@ func (p *DSPAParams) SetupObjectParams(ctx context.Context, dsp *dspa.DataScienc
265
276
)
266
277
p .ObjectStorageConnection .Port = config .MinioPort
267
278
p .ObjectStorageConnection .Scheme = config .MinioScheme
279
+ p .ObjectStorageConnection .Secure = util .BoolPointer (false )
280
+
268
281
if p .Minio .S3CredentialSecret != nil {
269
282
customCreds = p .Minio .S3CredentialSecret
270
283
}
@@ -343,6 +356,7 @@ func (p *DSPAParams) SetupObjectParams(ctx context.Context, dsp *dspa.DataScienc
343
356
}
344
357
345
358
return nil
359
+
346
360
}
347
361
348
362
func (p * DSPAParams ) SetupMLMD (ctx context.Context , dsp * dspa.DataSciencePipelinesApplication , client client.Client , log logr.Logger ) error {
0 commit comments