Skip to content

show user friendly error if git is not found #15574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions components/supervisor/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ var initCmd = &cobra.Command{
)
signal.Notify(sigInput, os.Interrupt, syscall.SIGTERM)

// check if git executable exists, supervisor will fail if it doesn't
// checking for it here allows to bubble up this error to the user
_, err = exec.LookPath("git")
if err != nil {
log.WithError(err).Fatal("cannot find git executable, make sure it is installed as part of gitpod image")
}

supervisorPath, err := os.Executable()
if err != nil {
supervisorPath = "/.supervisor/supervisor"
Expand Down
1 change: 1 addition & 0 deletions components/supervisor/pkg/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ func Run(options ...RunOption) {
log.WithError(err).Fatal("cannot ensure Gitpod user exists")
}
symlinkBinaries(cfg)

configureGit(cfg, childProcEnvvars)

tokenService := NewInMemoryTokenService()
Expand Down