mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
fix(e2e): keep the Proxmox tenant kubeconfig per run and remove it
run-proxmox.sh wrote the tenant's super-admin kubeconfig to $TMPDIR with
the process umask and never removed it, so it outlived the run on the
self-hosted runner, world-readable under the usual umask. dump_diagnostics
then read whatever sat at that path, so a run that failed before the
fetch reported the previous run's tenant as its own.
The file now lives under COZY_PROXMOX_WORKDIR, which the workflow points
at runner.temp. It is written under umask 077, removed at the start of
apply-tenant so this run never sees a leftover, removed again in the
suite's finally, and once more in the workflow's credential cleanup step
for a run killed before finally runs.
Closes #4806
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
Assisted-by: LLM
(cherry picked from commit 61238500dd)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
1 parent
a6a157df27
commit
2af6053079
3 files changed
+37
-4
No files matched your search
@@ -49,6 +49,11 @@ jobs:
|
||||
COZY_PVE_SSH: ${{ vars.PROXMOX_SSH }}
|
||||
COZY_PVE_SSH_KEY: ${{ github.workspace }}/.ssh-pve
|
||||
COZY_KEEP_TENANT: ${{ inputs.keep_tenant == true }}
|
||||
# Where run-proxmox.sh keeps the tenant's super-admin kubeconfig for the
|
||||
# run. runner.temp is emptied by the runner between jobs, and the cleanup
|
||||
# step below removes the file as well; see the script for why neither is
|
||||
# left to /tmp.
|
||||
COZY_PROXMOX_WORKDIR: ${{ runner.temp }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
@@ -157,4 +162,6 @@ jobs:
|
||||
|
||||
- name: Remove staged credentials
|
||||
if: always()
|
||||
run: rm -f "$GITHUB_WORKSPACE/.kubeconfig" "$COZY_PVE_SSH_KEY"
|
||||
# The tenant kubeconfig is the suite's, fetched by run-proxmox.sh; its
|
||||
# finally removes it too, but a run killed mid-step never reaches that.
|
||||
run: rm -f "$GITHUB_WORKSPACE/.kubeconfig" "$COZY_PVE_SSH_KEY" "$COZY_PROXMOX_WORKDIR/proxmox-e2e-tenant.kubeconfig"
|
||||
Reference in new issue
Block a user