Skip to content

Commit 493f771

Browse files
oceanc80openshift-merge-bot[bot]
authored andcommitted
UPSTREAM: <drop>: Revert "Add support for SSL env vars to cert pool watcher (#1672)"
This reverts commit d9af7f2.
1 parent 8862e94 commit 493f771

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

internal/httputil/certpoolwatcher.go

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"crypto/x509"
55
"fmt"
66
"os"
7-
"slices"
8-
"strings"
97
"sync"
108
"time"
119

@@ -46,26 +44,8 @@ func NewCertPoolWatcher(caDir string, log logr.Logger) (*CertPoolWatcher, error)
4644
if err != nil {
4745
return nil, err
4846
}
49-
50-
// If the SSL_CERT_DIR or SSL_CERT_FILE environment variables are
51-
// specified, this means that we have some control over the system root
52-
// location, thus they may change, thus we should watch those locations.
53-
watchPaths := strings.Split(os.Getenv("SSL_CERT_DIR"), ":")
54-
watchPaths = append(watchPaths, caDir, os.Getenv("SSL_CERT_FILE"))
55-
watchPaths = slices.DeleteFunc(watchPaths, func(p string) bool {
56-
if p == "" {
57-
return true
58-
}
59-
if _, err := os.Stat(p); err != nil {
60-
return true
61-
}
62-
return false
63-
})
64-
65-
for _, p := range watchPaths {
66-
if err := watcher.Add(p); err != nil {
67-
return nil, err
68-
}
47+
if err = watcher.Add(caDir); err != nil {
48+
return nil, err
6949
}
7050

7151
cpw := &CertPoolWatcher{

internal/httputil/certpoolwatcher_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ func TestCertPoolWatcher(t *testing.T) {
7272
t.Logf("Create cert file at %q\n", certName)
7373
createCert(t, certName)
7474

75-
// Update environment variables for the watcher - some of these should not exist
76-
os.Setenv("SSL_CERT_DIR", tmpDir+":/tmp/does-not-exist.dir")
77-
os.Setenv("SSL_CERT_FILE", "/tmp/does-not-exist.file")
78-
7975
// Create the cert pool watcher
8076
cpw, err := httputil.NewCertPoolWatcher(tmpDir, log.FromContext(context.Background()))
8177
require.NoError(t, err)

0 commit comments

Comments
 (0)