Skip to content

Commit 19c0a6a

Browse files
committed
UPSTREAM: <drop>: Separate CA configuration for pulls vs catalogd services
1 parent bd9b011 commit 19c0a6a

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

catalogd/cmd/catalogd/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func main() {
9898
certFile string
9999
keyFile string
100100
webhookPort int
101-
caCertDir string
101+
pullCasDir string
102102
globalPullSecret string
103103
)
104104
flag.StringVar(&metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':7443')")
@@ -116,7 +116,7 @@ func main() {
116116
flag.StringVar(&certFile, "tls-cert", "", "The certificate file used for serving catalog and metrics. Required to enable the metrics server. Requires tls-key.")
117117
flag.StringVar(&keyFile, "tls-key", "", "The key file used for serving catalog contents and metrics. Required to enable the metrics server. Requires tls-cert.")
118118
flag.IntVar(&webhookPort, "webhook-server-port", 9443, "The port that the mutating webhook server serves at.")
119-
flag.StringVar(&caCertDir, "ca-certs-dir", "", "The directory of CA certificate to use for verifying HTTPS connections to image registries.")
119+
flag.StringVar(&pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to image registries.")
120120
flag.StringVar(&globalPullSecret, "global-pull-secret", "", "The <namespace>/<name> of the global pull secret that is going to be used to pull bundle images.")
121121

122122
klog.InitFlags(flag.CommandLine)
@@ -272,8 +272,8 @@ func main() {
272272
BaseCachePath: unpackCacheBasePath,
273273
SourceContextFunc: func(logger logr.Logger) (*types.SystemContext, error) {
274274
srcContext := &types.SystemContext{
275-
DockerCertPath: caCertDir,
276-
OCICertPath: caCertDir,
275+
DockerCertPath: pullCasDir,
276+
OCICertPath: pullCasDir,
277277
}
278278
if _, err := os.Stat(authFilePath); err == nil && globalPullSecretKey != nil {
279279
logger.Info("using available authentication information for pulling image")

catalogd/config/components/ca/patches/manager_deployment_cacerts.yaml

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

cmd/operator-controller/main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ func main() {
102102
cachePath string
103103
operatorControllerVersion bool
104104
systemNamespace string
105-
caCertDir string
105+
catalogdCasDir string
106+
pullCasDir string
106107
globalPullSecret string
107108
)
108109
flag.StringVar(&metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':8443')")
109110
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
110-
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.")
111+
flag.StringVar(&catalogdCasDir, "catalogd-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to the Catalogd web service.")
112+
flag.StringVar(&pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to image registries.")
111113
flag.StringVar(&certFile, "tls-cert", "", "The certificate file used for the metrics server. Required to enable the metrics server. Requires tls-key.")
112114
flag.StringVar(&keyFile, "tls-key", "", "The key file used for the metrics server. Required to enable the metrics server. Requires tls-cert")
113115
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
@@ -284,7 +286,7 @@ func main() {
284286
os.Exit(1)
285287
}
286288

287-
certPoolWatcher, err := httputil.NewCertPoolWatcher(caCertDir, ctrl.Log.WithName("cert-pool"))
289+
certPoolWatcher, err := httputil.NewCertPoolWatcher(catalogCasDir, ctrl.Log.WithName("cert-pool"))
288290
if err != nil {
289291
setupLog.Error(err, "unable to create CA certificate pool")
290292
os.Exit(1)
@@ -307,8 +309,8 @@ func main() {
307309
BaseCachePath: filepath.Join(cachePath, "unpack"),
308310
SourceContextFunc: func(logger logr.Logger) (*types.SystemContext, error) {
309311
srcContext := &types.SystemContext{
310-
DockerCertPath: caCertDir,
311-
OCICertPath: caCertDir,
312+
DockerCertPath: pullCasDir,
313+
OCICertPath: pullCasDir,
312314
}
313315
if _, err := os.Stat(authFilePath); err == nil && globalPullSecretKey != nil {
314316
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,7 +6,10 @@
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"
1013
- op: add
1114
path: /spec/template/spec/containers/0/args/-
1215
value: "--tls-cert=/var/certs/tls.cert"

0 commit comments

Comments
 (0)