Repository navigation
EPMDEDP-17426: fix: Clone and push with the git binary on Alpine 3.24 - #326
Open
geekhubuser wants to merge 1 commit into
Open
geekhubuser wants to merge 1 commit into
geekhubuser wants to merge 1 commit into
Conversation
geekhubuser
force-pushed
the
EPMDEDP-17426
branch
2 times, most recently
from
October 22, 2026 21:39
c379713 to
3dc1950
Compare
geekhubuser
force-pushed
the
EPMDEDP-17426
branch
from
October 26, 2026 12:50
3dc1950 to
4af520d
Compare
geekhubuser
force-pushed
the
EPMDEDP-17426
branch
from
October 26, 2026 13:16
4af520d to
3309f00
Compare
Collaborator
Pipeline
|
| Status | Task | Duration |
|---|---|---|
| ✓ Passed | github-set-pending-status | 5s |
| ✓ Passed | fetch-repository | 12s |
| ✓ Passed | init-values | 5s |
| ✓ Passed | get-cache | 2m1s |
| ✗ Failed | commit-validate | 6s |
| ✓ Passed | dockerfile-lint | 7s |
| ✓ Passed | github-report-pipeline-status | 8s |
Pushing new commits re-runs this pipeline automatically.
To re-run it without new commits, comment/recheck.
✗ commit-validate / commit-validate — exit code 1, last 100 log lines
[TEKTON] Pattern to validate commit message: ^EPMDEDP-\d+: (fix|feat|docs|style|refactor|test|chore)(!)?: .+$
[TEKTON] Commit message to validate has been fetched:
EPMDEDP-17426: fix: Clone and push with the git binary, build on Alpine 3.24
- Run Clone and Push with the git binary: go-git does both inside the operator, and onboarding a large repository exceeded the 1Gi memory limit
- GIT_CLI_ENABLED (chart value gitCliEnabled, default true) set to false returns to go-git
- Keep go-git's behaviour on the git path: host key verification and its messages, the GitServer user, token auth through the environment only, SSL_CERT_DIR CAs, keys with CRLF or without a final newline, the empty-remote error
- Clone checks out after fetching every branch, and removes a partial clone after any failure, for both engines
- Checkout fetches branches and tags only, not every pull request ref
- Bound git's memory (delta threads, delta window bytes, big-file threshold), keep TLS verification on, and turn git maintenance off: the operator is PID 1 and does not reap it
- Log the clone and push engine at startup, and exit when the git binary is missing
- Build on alpine:3.24 with git and openssh-client pinned by minor: the Alpine 3.18 index dropped the pinned ca-certificates and broke every build
[TEKTON] A line in the commit message is too long. Each line should be no longer than 200 characters.
- Run Clone and Push with the git binary: go-git does both inside the operator, and onboarding a large repository exceeded the 1Gi memory limit - GIT_CLI_ENABLED (chart value gitCliEnabled, default true) set to false returns to go-git - Keep go-git's behaviour on the git path: host key verification and its messages, the GitServer user, keys go-git reads, the CAs Go trusts, an atomic push, the empty-remote error - Pass the token only through a credential helper that answers for the remote's own host, and no inherited GIT_ variable but the config file locations - Clone checks out after fetching every branch, and removes a partial clone after any failure, for both engines - Checkout fetches branches and tags only, not every pull request ref - Bound git's memory (delta threads, delta window bytes, big-file threshold), keep TLS verification on, and turn git maintenance off: the operator is PID 1 and does not reap it - Log the clone and push engine at startup, and exit when the git binary is missing - Build on alpine:3.24 with git and openssh-client pinned by minor: the Alpine 3.18 index dropped the pinned ca-certificates and broke every build
geekhubuser
force-pushed
the
EPMDEDP-17426
branch
from
October 26, 2026 20:23
3309f00 to
5de2a52
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The image no longer builds, on any PR or on master. On 2026-10-20 the Alpine 3.18 x86_64 index replaced the pinned
ca-certificates 20241121-r1with20261020-r0, and Alpine keeps one version per branch:The operator also cannot onboard a large repository. Since 2.29.0 go-git clones and pushes inside the operator process. With strategy
clone, apache/kafka (312 MB) gets the operator OOM-killed at the default 1Gi limit while it pushes the branches and tags, on the current image and on a fixed one alike, and every restart starts the onboarding again, so the Codebase staysin progress.This change:
pkg/git/cli.go,CLIProvider); every other operation stays on go-git.GIT_CLI_ENABLED(chart valuegitCliEnabled, defaulttrue) set tofalsereturns to go-git without a new image.alpine:3.24withgit~=2.54andopenssh-client~=10.3, pinned by minor as in gerrit-operator, and keeps master'sentrypointanduser_setup, which give the random UID OpenShift assigns a passwd entry; ssh needs one.SSH_KNOWN_HOSTS, with the same messages (sshhostkey.OpenSSHOptions,EnrichOutput);-l; Gerrit URLs carry none);SSL_CERT_FILEor the system bundle, plus theSSL_CERT_DIRdirectories), collected intoGIT_SSL_CAINFObecause git reads neither variable, without blocks that do not parse;ErrEmptyRemoteRepository, a remote HEAD that names a missing branch withErrReferenceNotFound, and a push without refspecs pushes every branch;.gitattributesconversion on checkout, since go-git commits on that checkout later.refs/*(apache/kafka advertises about 29,000 pull request refs).pack.threads), so it does not grow with the node's CPU count; a 100 MiB delta window per thread (pack.windowMemory); blobs over 64 MiB streamed without a delta search (core.bigFileThreshold).GIT_variable except the config file locations, soGIT_DIRcannot point it at another repository andGIT_SSL_NO_VERIFYcannot turn TLS verification off; turns git maintenance off, because the operator is PID 1 and does not reap a detached process.GIT_CLI_ENABLEDvalue, exits when the git binary is missing, and logs an error when ssh is missing or the UID has no passwd entry for it.Fixes EPMDEDP-17426 (codebase-operator part; the gerrit-operator part is epam/edp-gerrit-operator#103)
Type of change
How Has This Been Tested?
kind platform with GitLab (try-kuberocketci),
codebase-operatorswitched to an image built from this branch, default 1Gi memory limit, cgroup v2:clonecreatedin 118 s; 0 restarts,oom_kill0; every branch and tag in GitLab. With go-git the same onboarding was OOM-killedclonecreatedin 510 s; 0 restarts,oom_kill0; every branch and tag in GitLabgit pushunder a 1 GiB limit in this imagepack.windowMemoryandcore.bigFileThreshold: anon 87 MiB, all pusheddefaultBranch: 4.0, not the source HEAD, so the go-git checkout fetch runs toocreated; 0 restarts,oom_kill0; every branch and tag in GitLabcreate(template over HTTPS, push over SSH), then a CodebaseBranchcreated, both branches in GitLab; git and git-remote-http seen in the containerrunAsUser: 1000680000,runAsGroup: 0, as OpenShift assigns, strategyclonecreated;whoamiresolves through the entrypoint; ssh ranGIT_CLI_ENABLED=falsecreatedwith go-git; no git or ssh process in the container2.37.0-SNAPSHOT.1The kafka, kubernetes and memory rows ran on this commit, and the binary row ran this image's git with the operator's settings. The other rows ran on an earlier build of the branch, before the review changes (byte caps, cleanup after a failed clone).
Local checks, in
golang:1.26(Go 1.26.9) on a copy of the branch:make build(amd64, arm64),make testmake linthelm lint,helm templateGIT_CLI_ENABLEDrenders"true", and"false"with--set gitCliEnabled=falsemake helm-docsgit~=2.54andopenssh-client~=10.3resolve from the aarch64 index; the image itself was not built here (no arm64 emulation on this host)alpine:3.24(OpenSSH 10.3)-lon a URL without a user; missing and changed host keys give the go-git messages; CRLF and no-newline keys workSSL_CERT_DIR), an ssh stand-in, a branch moved during the clone; each fix's test fails when the fix is removedNot run live: the Gerrit, GitHub and Bitbucket providers and
caCerts.enabled, because the testbed has GitLab only, and theimportstrategy. The sshd run covers the Gerrit URL form, the HTTPS unit test covers the CA path, and the import steps (clone, remote branch checkout, commit, push) were run against sshd outside a Codebase.Checklist:
Additional context
Upgrade notes:
gitCliEnabled: falsereturns to go-git.resources.limits.memorylike the operator's own. On cgroup v2 an OOM kills the whole container (memory.oom.group).runAsUserand a non-zerorunAsGroup, SSH clone and push fail, and the operator logs it at startup: use group 0, orgitCliEnabled: false.https_proxy/HTTPS_PROXYandno_proxy, but forhttp://URLs only the lowercasehttp_proxy, and ssh ignoresALL_PROXY. go-git honoured both; if you rely on them, usegitCliEnabled: false.[host]:22(use the plain host form for port 22, asssh-keyscanprints it).Content-Length.TMPDIR(/tmp) must be writable, also with a read-only root filesystem.Seen during the validation, not changed here: after the first push of a repository with many branches, GitLab's post-receive processing ran after the operator's default-branch call and kept the first pushed branch as the project default (kafka, kubernetes). This happens with go-git too.
Rollback:
gitCliEnabled: false, with no image change. The previous image tag no longer builds, which is the bug.#325 (EPMDEDP-17422) fails
build-and-pushfor this reason and needs this change on master first.