Skip to content

Commit

Permalink
fix(kerberos): stop ticket renewal when pod is terminated (reanahub#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonadoni committed Apr 18, 2024
1 parent 08cbfa1 commit a7bcf7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions reana_commons/k8s/kerberos.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ def get_kerberos_k8s_config(
"volumeMounts": [secrets_volume_mount] + volume_mounts,
"env": env,
"securityContext": {"runAsUser": kubernetes_uid},
"lifecycle": {
# make sure we stop the sidecar container when the pod is stopped,
# for example when the run-batch pod is terminated by reana-workflow-controller
# after the workflow finishes (either successfully or with an error)
"preStop": {"exec": {"command": ["touch", KRB5_STATUS_FILE_LOCATION]}}
},
}

return KerberosConfig(
Expand Down

0 comments on commit a7bcf7a

Please sign in to comment.