Skip to content

Commit c34f893

Browse files
authored
Run update-ca-certificates also when debug flag is present (#503)
* Run update-ca-certificates also when debug flag is present. * Do not call update-ca-certs when starting debug shell
1 parent 72db9b2 commit c34f893

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

internal/infra/run.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,17 +451,17 @@ func runContainers(ctx context.Context, params RunParams) (err error) {
451451
}
452452
}
453453

454+
// update CA certificates as root prior to start debug shell or running dependabot commands
455+
if err := updater.RunCmd(ctx, "update-ca-certificates", root); err != nil {
456+
return err
457+
}
458+
454459
if params.Debug {
455460
if err := updater.RunShell(ctx, prox.url, params.ApiUrl, params.Job, params.UpdaterEnvironmentVariables); err != nil {
456461
return err
457462
}
458463
} else {
459-
// First, update CA certificates as root
460-
if err := updater.RunCmd(ctx, "update-ca-certificates", root); err != nil {
461-
return err
462-
}
463-
464-
// Then run the dependabot commands as the dependabot user
464+
// Run dependabot commands as a dependabot user
465465
env := userEnv(prox.url, params.ApiUrl, params.Job, params.UpdaterEnvironmentVariables)
466466
if params.Flamegraph {
467467
env = append(env, "FLAMEGRAPH=1")

internal/infra/updater.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func (u *Updater) RunShell(ctx context.Context, proxyURL string, apiUrl string,
343343
Tty: true,
344344
User: dependabot,
345345
Env: append(userEnv(proxyURL, apiUrl, job, additionalEnvVars), "DEBUG=1"),
346-
Cmd: []string{"/bin/bash", "-c", "update-ca-certificates && /bin/bash"},
346+
Cmd: []string{"/bin/bash"},
347347
})
348348
if err != nil {
349349
return fmt.Errorf("failed to create exec: %w", err)

0 commit comments

Comments
 (0)