Skip to content

Commit 859b4d2

Browse files
tmshortopenshift-merge-bot[bot]
authored andcommitted
UPSTREAM: <drop>: Separate CA configuration for pulls vs catalogd services (#1673)
Rename the flags that provide CAs to image pulling to indicate the use. Keep the old flag around (for backward compatibility), but prefer the new flag(s). Signed-off-by: Todd Short <tshort@redhat.com>
1 parent d9af7f2 commit 859b4d2

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

cmd/manager/main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,14 @@ func main() {
9595
cachePath string
9696
operatorControllerVersion bool
9797
systemNamespace string
98-
caCertDir string
98+
catalogdCasDir string
99+
pullCasDir string
99100
globalPullSecret string
100101
)
101102
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
102103
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
103-
flag.StringVar(&caCertDir, "ca-certs-dir", "", "The directory of TLS certificate to use for verifying HTTPS connections to the Catalogd and docker-registry web servers.")
104+
flag.StringVar(&catalogdCasDir, "catalogd-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to the Catalogd web service.")
105+
flag.StringVar(&pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to image registries.")
104106
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
105107
"Enable leader election for controller manager. "+
106108
"Enabling this will ensure there is only one active controller manager.")
@@ -221,7 +223,7 @@ func main() {
221223
os.Exit(1)
222224
}
223225

224-
certPoolWatcher, err := httputil.NewCertPoolWatcher(caCertDir, ctrl.Log.WithName("cert-pool"))
226+
certPoolWatcher, err := httputil.NewCertPoolWatcher(catalogdCasDir, ctrl.Log.WithName("cert-pool"))
225227
if err != nil {
226228
setupLog.Error(err, "unable to create CA certificate pool")
227229
os.Exit(1)
@@ -231,8 +233,8 @@ func main() {
231233
BaseCachePath: filepath.Join(cachePath, "unpack"),
232234
SourceContextFunc: func(logger logr.Logger) (*types.SystemContext, error) {
233235
srcContext := &types.SystemContext{
234-
DockerCertPath: caCertDir,
235-
OCICertPath: caCertDir,
236+
DockerCertPath: pullCasDir,
237+
OCICertPath: pullCasDir,
236238
}
237239
if _, err := os.Stat(authFilePath); err == nil && globalPullSecretKey != nil {
238240
logger.Info("using available authentication information for pulling image")

config/components/tls/patches/manager_deployment_cert.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
value: {"name":"olmv1-certificate", "readOnly": true, "mountPath":"/var/certs/"}
77
- op: add
88
path: /spec/template/spec/containers/0/args/-
9-
value: "--ca-certs-dir=/var/certs"
9+
value: "--catalogd-cas-dir=/var/certs"
10+
- op: add
11+
path: /spec/template/spec/containers/0/args/-
12+
value: "--pull-cas-dir=/var/certs"

0 commit comments

Comments
 (0)