Skip to content

Commit 24d183c

Browse files
committed
Minor cert handling modifications
Signed-off-by: Ben <[email protected]>
1 parent b4e69bd commit 24d183c

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

pkg/system/phase2_creating.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ func (r *Reconciler) setDesiredCoreEnv(c *corev1.Container) {
473473
c.Env[j].Value = "true"
474474
}
475475
case "NODE_EXTRA_CA_CERTS":
476-
c.Env[j].Value = r.ApplyCAsToPods
476+
c.Env[j].Value = util.CombinedCaBundlePath
477477
case "GUARANTEED_LOGS_PATH":
478478
if r.NooBaa.Spec.BucketLogging.LoggingType == nbv1.BucketLoggingTypeGuaranteed {
479479
c.Env[j].Value = r.BucketLoggingVolumeMount

pkg/system/phase4_configuring.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ func (r *Reconciler) SetDesiredDeploymentEndpoint() error {
414414
c.Env[j].Value = ""
415415
}
416416
case "NODE_EXTRA_CA_CERTS":
417-
c.Env[j].Value = r.ApplyCAsToPods
417+
c.Env[j].Value = util.CombinedCaBundlePath
418418
case "GUARANTEED_LOGS_PATH":
419419
if r.NooBaa.Spec.BucketLogging.LoggingType == nbv1.BucketLoggingTypeGuaranteed {
420420
c.Env[j].Value = r.BucketLoggingVolumeMount
@@ -1371,7 +1371,7 @@ func (r *Reconciler) prepareCephBackingStore() error {
13711371
Transport: util.InsecureHTTPTransport,
13721372
Timeout: 10 * time.Second,
13731373
}
1374-
if r.ApplyCAsToPods != "" {
1374+
if r.UseRefreshingTransport {
13751375
client.Transport = util.GlobalCARefreshingTransport
13761376
}
13771377

pkg/system/reconciler.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ type Reconciler struct {
6868
OperatorVersion string
6969
OAuthEndpoints *util.OAuth2Endpoints
7070
PostgresConnectionString string
71-
ApplyCAsToPods string // the CA will be applied to the core and endpoint pods
71+
UseRefreshingTransport bool
7272

7373
NooBaa *nbv1.NooBaa
7474
ServiceAccount *corev1.ServiceAccount
@@ -406,8 +406,7 @@ func (r *Reconciler) Reconcile() (reconcile.Result, error) {
406406

407407
err = util.CombineCaBundle(util.ServiceServingCertCAFile)
408408
if err == nil {
409-
// r.ApplyCAsToPods = util.InjectedBundleCertCAFile
410-
r.ApplyCAsToPods = util.ServiceServingCertCAFile // back as it was
409+
r.UseRefreshingTransport = true
411410
} else if !os.IsNotExist(err) {
412411
log.Errorf("❌ NooBaa %q failed to add root CAs to system default", r.NooBaa.Name)
413412
res.RequeueAfter = 3 * time.Second

pkg/util/util.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ const (
9090

9191
// InjectedBundleCertCAFile points to OCP root CA to be added to the default root CA list
9292
InjectedBundleCertCAFile = "/etc/ocp-injected-ca-bundle/ca-bundle.crt"
93+
94+
// CombinedCaBundlePath points to the combined CA bundle file
95+
CombinedCaBundlePath = "/tmp/ca-bundle.crt"
9396
)
9497

9598
// OAuth2Endpoints holds OAuth2 endpoints information.

0 commit comments

Comments
 (0)