Skip to content

Commit a7bcf7a

Browse files
committed
fix(kerberos): stop ticket renewal when pod is terminated (#454)
Closes reanahub/reana-job-controller#449
1 parent 08cbfa1 commit a7bcf7a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

reana_commons/k8s/kerberos.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ def get_kerberos_k8s_config(
126126
"volumeMounts": [secrets_volume_mount] + volume_mounts,
127127
"env": env,
128128
"securityContext": {"runAsUser": kubernetes_uid},
129+
"lifecycle": {
130+
# make sure we stop the sidecar container when the pod is stopped,
131+
# for example when the run-batch pod is terminated by reana-workflow-controller
132+
# after the workflow finishes (either successfully or with an error)
133+
"preStop": {"exec": {"command": ["touch", KRB5_STATUS_FILE_LOCATION]}}
134+
},
129135
}
130136

131137
return KerberosConfig(

0 commit comments

Comments
 (0)