fix(gitlab-runner-vm): close remaining review gaps in executor and provisioning - #4
Merged
waynesun09 merged 1 commit intoAug 17, 2026
Conversation
waynesun09
force-pushed
the
pr5951-review-fixes
branch
from
August 17, 2026 19:43
e850820 to
8792c40
Compare
ggallen
force-pushed
the
gitlab-runner-vm-setup
branch
from
August 17, 2026 20:05
bf6c5aa to
a18c3db
Compare
waynesun09
force-pushed
the
pr5951-review-fixes
branch
from
August 17, 2026 20:10
8792c40 to
6af7a03
Compare
…ovisioning Follow-ups from the Grok review of the previous fix commit. Executor: - Forward CUSTOM_ENV_* with `--env NAME` so podman copies values from its environment; values no longer appear in podman's argv. The exports happen in a subshell that execs podman, so a job variable named PATH or HOME cannot alter this script. The few names that steer the podman process itself (PATH, HOME, TMPDIR, XDG_*, CONTAINERS_*, LD_*) are passed inline. - cleanup.sh no longer returns early on an unexpected container name — the staged copy of the gateway mTLS material must be removed regardless. - Reject control characters in resolved bind-mount paths; report the real reason when a stale container cannot be removed. - Fixture test: identity cases (spoofed CUSTOM_ENV_CI_JOB_ID ignored; missing, unreadable, non-int, and malformed JOB_RESPONSE_FILE rejected) and a control-character path case. Provisioning: - Write .env and run setup.sh in one remote session whose EXIT trap removes the token-bearing file, with HUP/INT/TERM handlers that terminate the shell. A handler that merely returned would swallow the SIGHUP from a dropped SSH connection and leave setup.sh running while the local side deregistered the runner. Disarm the INT/TERM rollback traps on success and exit 143 on TERM. - Template VM_USER into cloud-init so the knob is wired end to end, and validate VM_USER and RUNNER_ACCESS_LEVEL before the VM exists. - Validate every certificate in the TOFU chain (crl2pkcs7 | pkcs7 -print_certs), not just the first. - Match the active-gateway marker with optional leading whitespace, and match `(NotFound)` exactly in delete-vm.sh. Assisted-by: Claude (fix), Grok (review) Signed-off-by: Wayne Sun <gsun@redhat.com>
waynesun09
force-pushed
the
pr5951-review-fixes
branch
from
August 17, 2026 20:11
6af7a03 to
07ce176
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.
Thanks for taking the first round into
a18c3db4— this is now just the follow-up delta from a Grok review of that fix commit, rebased onto your current head. YourPRE_COMMIT_HOME/GOCACHEenvs and thechmod 700are preserved. One commit, +122/−42.What this fixes
Executor
--env NAMEinstead of--env NAME=VALUE— podman copies the value from its own environment, so job variables (including file-type PEM material andCI_JOB_TOKEN) no longer appear in podman's argv //proc/<pid>/cmdline. Exports happen in a subshell that execs podman, so a job variable namedPATHorHOMEcan't alterrun.sh; the handful of names that steer the podman process itself (PATH,HOME,TMPDIR,XDG_*,CONTAINERS_*,LD_*) go inline since they're never secrets.cleanup.shno longer returns early on an unexpected container name — the staged copy of the gateway mTLS material is removed regardless.CUSTOM_ENV_CI_JOB_IDis ignored; missing / unreadable / non-int / malformedJOB_RESPONSE_FILEall fail before podman.Provisioning
trap 'rm -f .env' EXIT INT TERM HUPhandler didn'texit, so it swallowed the SIGHUP from a dropped SSH connection and letsetup.shkeep running while the local side deregistered the runner. Now.envwrite +setup.shrun in one remote session with anEXITtrap plusHUP/INT/TERMhandlers that terminate the shell — and there's no longer a window where the token file exists without a trap covering it.VM_USERtemplated into cloud-init (__VM_USER__invm.yaml— the onlyvm.yamlchange; resources untouched) so the knob is wired end to end;VM_USERandRUNNER_ACCESS_LEVELvalidated before the VM exists.openssl crl2pkcs7 | pkcs7 -print_certs), not just the leaf, so a mid-chain truncation can't install.(NotFound)matched exactly indelete-vm.sh.Verification
bash -n+shellcheck -x -e SC1091,SC2001,SC2016clean on all scriptsfullsend-ai/fullsend:main,git merge-treeclean