Skip to content

Commit 290b075

Browse files
authored
Merge pull request #2037 from fcrozat/suse_certificates
add Certificate location for SUSE products
2 parents 3337d24 + 8ced382 commit 290b075

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

controllers/object_controls.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,13 @@ var RepoConfigPathMap = map[string]string{
206206
// Where OCP mounts proxy certs on RHCOS nodes:
207207
// https://access.redhat.com/documentation/en-us/openshift_container_platform/4.3/html/authentication/ocp-certificates#proxy-certificates_ocp-certificates
208208
var CertConfigPathMap = map[string]string{
209-
"centos": "/etc/pki/ca-trust/extracted/pem",
210-
"debian": "/usr/local/share/ca-certificates",
211-
"ubuntu": "/usr/local/share/ca-certificates",
212-
"rhcos": "/etc/pki/ca-trust/extracted/pem",
213-
"rhel": "/etc/pki/ca-trust/extracted/pem",
209+
"centos": "/etc/pki/ca-trust/extracted/pem",
210+
"debian": "/usr/local/share/ca-certificates",
211+
"ubuntu": "/usr/local/share/ca-certificates",
212+
"rhcos": "/etc/pki/ca-trust/extracted/pem",
213+
"rhel": "/etc/pki/ca-trust/extracted/pem",
214+
"sles": "/etc/pki/trust/anchors",
215+
"sl-micro": "/etc/pki/trust/anchors",
214216
}
215217

216218
// MountPathToVolumeSource maps a container mount path to a VolumeSource

controllers/object_controls_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,3 +1461,21 @@ func TestParseOSReleaseFromFile(t *testing.T) {
14611461
require.True(t, os.IsNotExist(err))
14621462
})
14631463
}
1464+
1465+
func TestCertConfigPathMap(t *testing.T) {
1466+
expectedPaths := map[string]string{
1467+
"centos": "/etc/pki/ca-trust/extracted/pem",
1468+
"debian": "/usr/local/share/ca-certificates",
1469+
"ubuntu": "/usr/local/share/ca-certificates",
1470+
"rhcos": "/etc/pki/ca-trust/extracted/pem",
1471+
"rhel": "/etc/pki/ca-trust/extracted/pem",
1472+
"sles": "/etc/pki/trust/anchors",
1473+
"sl-micro": "/etc/pki/trust/anchors",
1474+
}
1475+
1476+
for os, expectedPath := range expectedPaths {
1477+
path, ok := CertConfigPathMap[os]
1478+
require.True(t, ok, "OS %s not found in CertConfigPathMap", os)
1479+
require.Equal(t, expectedPath, path, "Incorrect path for OS %s", os)
1480+
}
1481+
}

internal/state/driver_volumes.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ var RepoConfigPathMap = map[string]string{
4444
// Where OCP mounts proxy certs on RHCOS nodes:
4545
// https://access.redhat.com/documentation/en-us/openshift_container_platform/4.3/html/authentication/ocp-certificates#proxy-certificates_ocp-certificates
4646
var CertConfigPathMap = map[string]string{
47-
"centos": "/etc/pki/ca-trust/extracted/pem",
48-
"debian": "/usr/local/share/ca-certificates",
49-
"ubuntu": "/usr/local/share/ca-certificates",
50-
"rhcos": "/etc/pki/ca-trust/extracted/pem",
51-
"rhel": "/etc/pki/ca-trust/extracted/pem",
47+
"centos": "/etc/pki/ca-trust/extracted/pem",
48+
"debian": "/usr/local/share/ca-certificates",
49+
"ubuntu": "/usr/local/share/ca-certificates",
50+
"rhcos": "/etc/pki/ca-trust/extracted/pem",
51+
"rhel": "/etc/pki/ca-trust/extracted/pem",
52+
"sles": "/etc/pki/trust/anchors",
53+
"sl-micro": "/etc/pki/trust/anchors",
5254
}
5355

5456
// MountPathToVolumeSource maps a container mount path to a VolumeSource

0 commit comments

Comments
 (0)