fix: force restartPolicy "Never" to prevent runner pods from stucking in Terminating when the container disappeared (#1395)

Ref #1369
This commit is contained in:
Yusuke Kuoka
2022-05-14 17:07:17 +09:00
committed by GitHub
parent 3014e98681
commit 759349de11
4 changed files with 30 additions and 12 deletions

View File

@@ -78,9 +78,7 @@ func (t *PodRunnerTokenInjector) Handle(ctx context.Context, req admission.Reque
updated.Annotations[AnnotationKeyTokenExpirationDate] = ts
if pod.Spec.RestartPolicy != corev1.RestartPolicyOnFailure {
updated.Spec.RestartPolicy = corev1.RestartPolicyOnFailure
}
forceRunnerPodRestartPolicyNever(updated)
buf, err := json.Marshal(updated)
if err != nil {