jenkins: clean stale JCasC files on startup

This commit is contained in:
Brad Stein 2025-12-17 00:37:37 -03:00
parent 30048a9ae5
commit 1f98a5be12

View File

@ -79,6 +79,21 @@ spec:
secretKeyRef: secretKeyRef:
name: jenkins-oidc name: jenkins-oidc
key: logoutUrl key: logoutUrl
customInitContainers:
- name: clean-jcasc-stale
image: alpine:3.20
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
set -euo pipefail
rm -f /var/jenkins_home/casc_configs/*.yaml || true
securityContext:
runAsUser: 0
volumeMounts:
- name: jenkins-home
mountPath: /var/jenkins_home
initScripts: initScripts:
oidc.groovy: | oidc.groovy: |
import hudson.util.Secret import hudson.util.Secret