Commit e3fcf9a
committed
fix: introduce per-job cert volume with %gcl% token
Jobs using docker:dind as a service share TLS client certificates via a
named volume. The previous approach relied on a static volume name (e.g.
`certs`) configured in .gitlab-ci-local-env, which caused race conditions
when concurrent jobs wrote to and cleaned up the same volume.
A new `%gcl%:` prefix in VOLUME entries is now resolved at runtime to a
per-job unique volume name (`gcl-<job>-<id>-cert`), matching the naming
pattern of the existing build/tmp volumes. The `%gcl%` token was chosen
because Docker hard-rejects it if it ever reaches the daemon unsubstituted
(invalid volume name character), rather than silently bind-mounting an
unintended host path.
Changes:
- get certVolumeName() getter returning a per-job unique name
- Cert volume is created and registered for cleanup alongside build/tmp
volumes when any %gcl%: entry is present in argv.volume
- %gcl%: prefix is resolved to certVolumeName in both the job container
and service container volume loops1 parent 98c6573 commit e3fcf9a
1 file changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
471 | 475 | | |
472 | 476 | | |
473 | 477 | | |
| |||
689 | 693 | | |
690 | 694 | | |
691 | 695 | | |
692 | | - | |
| 696 | + | |
693 | 697 | | |
694 | 698 | | |
695 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
696 | 705 | | |
697 | 706 | | |
698 | 707 | | |
| |||
1017 | 1026 | | |
1018 | 1027 | | |
1019 | 1028 | | |
1020 | | - | |
| 1029 | + | |
| 1030 | + | |
1021 | 1031 | | |
1022 | 1032 | | |
1023 | 1033 | | |
| |||
1580 | 1590 | | |
1581 | 1591 | | |
1582 | 1592 | | |
1583 | | - | |
| 1593 | + | |
| 1594 | + | |
1584 | 1595 | | |
1585 | 1596 | | |
1586 | 1597 | | |
| |||
0 commit comments