Skip to content

Commit 28f8f32

Browse files
shiradyNeon-White
authored andcommitted
in CombineCaBundle use const instead of hard-coded string
(to avoid circular dependency had to move the consts from options to util) Signed-off-by: shirady <[email protected]> Signed-off-by: Ben <[email protected]>
1 parent 5f0fa17 commit 28f8f32

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

pkg/options/options.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ const (
4848

4949
// SystemName is a constant as we want just a single system per namespace
5050
SystemName = "noobaa"
51-
52-
// ServiceServingCertCAFile points to OCP default root CA list
53-
ServiceServingCertCAFile = "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt"
54-
55-
// InjectedBundleCertCAFile points to OCP root CA to be added to the default root CA list
56-
InjectedBundleCertCAFile = "/etc/ocp-injected-ca-bundle/ca-bundle.crt"
5751
)
5852

5953
// Namespace is the target namespace for locating the noobaa system

pkg/system/reconciler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ func (r *Reconciler) Reconcile() (reconcile.Result, error) {
404404
}
405405
}
406406

407-
err = util.CombineCaBundle(options.ServiceServingCertCAFile)
407+
err = util.CombineCaBundle(util.ServiceServingCertCAFile)
408408
if err == nil {
409-
r.ApplyCAsToPods = options.InjectedBundleCertCAFile
409+
r.ApplyCAsToPods = util.InjectedBundleCertCAFile
410410
} else if !os.IsNotExist(err) {
411411
log.Errorf("❌ NooBaa %q failed to add root CAs to system default", r.NooBaa.Name)
412412
res.RequeueAfter = 3 * time.Second

pkg/util/util.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ const (
8484

8585
topologyConstraintsEnabledKubeVersion = "1.26.0"
8686
trueStr = "true"
87+
88+
// ServiceServingCertCAFile points to OCP default root CA list
89+
ServiceServingCertCAFile = "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt"
90+
91+
// InjectedBundleCertCAFile points to OCP root CA to be added to the default root CA list
92+
InjectedBundleCertCAFile = "/etc/ocp-injected-ca-bundle/ca-bundle.crt"
8793
)
8894

8995
// OAuth2Endpoints holds OAuth2 endpoints information.
@@ -151,7 +157,7 @@ func CombineCaBundle(localCertFile string) error {
151157
}
152158

153159
var certFiles = []string{
154-
"/etc/ocp-injected-ca-bundle/ca-bundle.crt",
160+
InjectedBundleCertCAFile,
155161
localCertFile,
156162
}
157163

0 commit comments

Comments
 (0)