@@ -66,7 +66,7 @@ type Reconciler struct {
6666 OperatorVersion string
6767 OAuthEndpoints * util.OAuth2Endpoints
6868 PostgresConnectionString string
69- ApplyCAsToPods string
69+ ApplyCAsToPods string // the path that will be applied to the core and endpoint pods in NODE_EXTRA_CA_CERTS
7070
7171 NooBaa * nbv1.NooBaa
7272 ServiceAccount * corev1.ServiceAccount
@@ -273,7 +273,7 @@ func NewReconciler(
273273 r .RouteS3 .Name = r .ServiceS3 .Name
274274 r .RouteSts .Name = r .ServiceSts .Name
275275 r .DeploymentEndpoint .Name = r .Request .Name + "-endpoint"
276- r .CaBundleConf .Name = r . Request . Name + "- ca-inject "
276+ r .CaBundleConf .Name = "ocp-injected- ca-bundle "
277277 r .KedaScaled .Name = r .Request .Name
278278 r .AdapterHPA .Name = r .Request .Name + "-hpav2"
279279 r .BucketLoggingPVC .Name = r .Request .Name + "-bucket-logging-pvc"
@@ -394,9 +394,30 @@ func (r *Reconciler) Reconcile() (reconcile.Result, error) {
394394 }
395395 }
396396
397- err = util .AddToRootCAs (options .ServiceServingCertCAFile )
397+ /*
398+ This code is problematic due to the way other parts of the product work.
399+ On the core side, get_unsecured_agent() relies on the presence of the NODE_EXTRA_CA_CERTS
400+ environment variable to determine whether an HTTP or HTTPS client should be used.
401+
402+ At the time of writing this comment, if the environment variable is not set, an HTTP agent
403+ will be used for *all* S3-compatible domains that aren't under amazonaws.com - including
404+ domains that are already present by default in the system's certificate store.
405+
406+ Forcing the environment variable to always be set leads to a different problem where
407+ some things might fail - e.g. the admission tests that rely on creating a namespacestore
408+ that points towards NooBaa's (self-signed) S3 service. In that case, the HTTPS agent fails
409+ due to the self-signed certificate.
410+
411+ Also, note that the code that combines certificates only applies to the operator.
412+ Based on whether the certificate bundling was successful, the operator will set the value of
413+ NODE_EXTRA_CA_CERTS in endpoints and core pods to point to *the system generated service-serving certs*.
414+
415+ At the time of writing, user certs are not included at any point.
416+ */
417+
418+ err = util .CombineCaBundle (util .ServiceServingCertCAFile )
398419 if err == nil {
399- r .ApplyCAsToPods = options .ServiceServingCertCAFile
420+ r .ApplyCAsToPods = util .ServiceServingCertCAFile
400421 } else if ! os .IsNotExist (err ) {
401422 log .Errorf ("❌ NooBaa %q failed to add root CAs to system default" , r .NooBaa .Name )
402423 res .RequeueAfter = 3 * time .Second
0 commit comments