Git-Linguist gem Not Available on UBI Images
Summary
The git-linguist
gem is not in the path on the Gitaly UBI8 Image.
Heres the error in the Gitaly Logs:
failed to load command: bin/ruby-cd (bin/ruby-cd)\nbin/ruby-cd:8:in `exec': No such file or directory - git-linguist
Steps to reproduce
➜ vault git:(gitlab-ci) ✗ docker run -ti registry.gitlab.com/gitlab-org/build/cng/gitaly:v14.1.7-ubi8 bash
+ /scripts/set-config /etc/gitaly /etc/gitaly
Begin parsing .erb files from /etc/gitaly
+ exec /scripts/exec-env bash
[git@eb6283f19d8c /]$ git-linguist
bash: git-linguist: command not found
[git@eb6283f19d8c /]$
However, it is available in the non-UBI image
➜ vault git:(gitlab-ci) ✗ docker run -ti registry.gitlab.com/gitlab-org/build/cng/gitaly:v14.1.7 bash
+ /scripts/set-config /etc/gitaly /etc/gitaly
Begin parsing .erb files from /etc/gitaly
+ exec /scripts/exec-env bash
git@07357c1668d6:/$ git-linguist --help
Linguist v7.12.1
Detect language type and determine language breakdown for a given Git repository.
Usage:
git-linguist [OPTIONS] stats|breakdown|dump-cache|clear|disable
-f, --force Force a full rescan
-c, --commit=COMMIT Commit to index
git@07357c1668d6:/$
Expected behavior
The git-linguist
should be in the UBI Image PATH. The executable is called in Gitaly via https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/gitaly/linguist/linguist.go#L90
Edited by Steve