Skip to content

Commit 4bb74cf

Browse files
authored
Revert "UPSTREAM: <drop>: Separate CA configuration for pulls vs catalogd services (#1673)"
This reverts commit c20afa6.
1 parent c20afa6 commit 4bb74cf

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
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-
pullCasDir string
101+
caCertDir 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(&pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authoritiess to use for verifying HTTPS connections to image registries.")
119+
flag.StringVar(&caCertDir, "ca-certs-dir", "", "The directory of CA certificate 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: pullCasDir,
276-
OCICertPath: pullCasDir,
275+
DockerCertPath: caCertDir,
276+
OCICertPath: caCertDir,
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: "--pull-cas-dir=/var/ca-certs"
9+
value: "--ca-certs-dir=/var/ca-certs"

cmd/operator-controller/main.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,12 @@ func main() {
102102
cachePath string
103103
operatorControllerVersion bool
104104
systemNamespace string
105-
catalogdCasDir string
106-
pullCasDir string
105+
caCertDir string
107106
globalPullSecret string
108107
)
109108
flag.StringVar(&metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':8443')")
110109
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
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.")
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.")
113111
flag.StringVar(&certFile, "tls-cert", "", "The certificate file used for the metrics server. Required to enable the metrics server. Requires tls-key.")
114112
flag.StringVar(&keyFile, "tls-key", "", "The key file used for the metrics server. Required to enable the metrics server. Requires tls-cert")
115113
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
@@ -286,7 +284,7 @@ func main() {
286284
os.Exit(1)
287285
}
288286

289-
certPoolWatcher, err := httputil.NewCertPoolWatcher(catalogdCasDir, ctrl.Log.WithName("cert-pool"))
287+
certPoolWatcher, err := httputil.NewCertPoolWatcher(caCertDir, ctrl.Log.WithName("cert-pool"))
290288
if err != nil {
291289
setupLog.Error(err, "unable to create CA certificate pool")
292290
os.Exit(1)
@@ -309,8 +307,8 @@ func main() {
309307
BaseCachePath: filepath.Join(cachePath, "unpack"),
310308
SourceContextFunc: func(logger logr.Logger) (*types.SystemContext, error) {
311309
srcContext := &types.SystemContext{
312-
DockerCertPath: pullCasDir,
313-
OCICertPath: pullCasDir,
310+
DockerCertPath: caCertDir,
311+
OCICertPath: caCertDir,
314312
}
315313
if _, err := os.Stat(authFilePath); err == nil && globalPullSecretKey != nil {
316314
logger.Info("using available authentication information for pulling image")

config/components/tls/patches/manager_deployment_cert.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +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: "--catalogd-cas-dir=/var/certs"
10-
- op: add
11-
path: /spec/template/spec/containers/0/args/-
12-
value: "--pull-cas-dir=/var/certs"
9+
value: "--ca-certs-dir=/var/certs"
1310
- op: add
1411
path: /spec/template/spec/containers/0/args/-
1512
value: "--tls-cert=/var/certs/tls.cert"

0 commit comments

Comments
 (0)