Skip to content

Commit 77279a8

Browse files
Pothulapatiroboquat
authored andcommitted
[initializer] Replace GIT_SSL_CAINFO with GIT_SSL_CAPATH
Fixes #10173 Using `GIT_SSL_CAPATH` means that we will continue to support publicly signed SCM's even when we have a `customCA` configured. Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent d5692f3 commit 77279a8

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

components/content-service/pkg/git/git.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ func (c *Client) GitWithOutput(ctx context.Context, subcommand string, args ...s
181181
if os.Getenv("https_proxy") != "" {
182182
env = append(env, fmt.Sprintf("https_proxy=%s", os.Getenv("https_proxy")))
183183
}
184+
if v := os.Getenv("GIT_SSL_CAPATH"); v != "" {
185+
env = append(env, fmt.Sprintf("GIT_SSL_CAPATH=%s", v))
186+
}
187+
184188
if v := os.Getenv("GIT_SSL_CAINFO"); v != "" {
185189
env = append(env, fmt.Sprintf("GIT_SSL_CAINFO=%s", v))
186190
}

components/ws-daemon/pkg/content/initializer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func RunInitializer(ctx context.Context, destination string, initializer *csapi.
202202
spec.Process.User.GID = opts.GID
203203
spec.Process.Args = []string{"/app/content-initializer"}
204204
for _, e := range os.Environ() {
205-
if strings.HasPrefix(e, "JAEGER_") || strings.HasPrefix(e, "GIT_SSL_CAINFO=") {
205+
if strings.HasPrefix(e, "JAEGER_") || strings.HasPrefix(e, "GIT_SSL_CAPATH=") || strings.HasPrefix(e, "GIT_SSL_CAINFO=") {
206206
spec.Process.Env = append(spec.Process.Env, e)
207207
}
208208
}

install/installer/pkg/common/ca.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ func CustomCACertVolume(ctx *RenderContext) (vol *corev1.Volume, mnt *corev1.Vol
6363
}
6464

6565
const (
66-
volumeName = "custom-ca-cert"
67-
mountPath = "/etc/ssl/certs/custom-ca.crt"
66+
volumeName = "custom-ca-cert"
67+
customCAMountPath = "/etc/ssl/certs/custom-ca.crt"
68+
certsMountPath = "/etc/ssl/certs/"
6869
)
6970
vol = &corev1.Volume{
7071
Name: volumeName,
@@ -83,12 +84,13 @@ func CustomCACertVolume(ctx *RenderContext) (vol *corev1.Volume, mnt *corev1.Vol
8384
mnt = &corev1.VolumeMount{
8485
Name: volumeName,
8586
ReadOnly: true,
86-
MountPath: mountPath,
87+
MountPath: customCAMountPath,
8788
SubPath: "ca.crt",
8889
}
8990
env = []corev1.EnvVar{
90-
{Name: "NODE_EXTRA_CA_CERTS", Value: mountPath},
91-
{Name: "GIT_SSL_CAINFO", Value: mountPath},
91+
{Name: "NODE_EXTRA_CA_CERTS", Value: customCAMountPath},
92+
{Name: "GIT_SSL_CAPATH", Value: certsMountPath},
93+
{Name: "GIT_SSL_CAINFO", Value: customCAMountPath},
9294
}
9395
ok = true
9496
return

0 commit comments

Comments
 (0)