Use --ephemeral by default

Ref https://github.com/actions-runner-controller/actions-runner-controller/issues/1189
This commit is contained in:
Yusuke Kuoka
2022-03-12 13:19:53 +00:00
parent 757e0a82a2
commit 051089733b
3 changed files with 48 additions and 11 deletions

View File

@@ -283,6 +283,21 @@ func getRunnerEnv(pod *corev1.Pod, key string) string {
return ""
}
func setRunnerEnv(pod *corev1.Pod, key, value string) {
for i := range pod.Spec.Containers {
c := pod.Spec.Containers[i]
if c.Name == containerName {
for j, env := range c.Env {
if env.Name == key {
pod.Spec.Containers[i].Env[j].Value = value
return
}
}
pod.Spec.Containers[i].Env = append(c.Env, corev1.EnvVar{Name: key, Value: value})
}
}
}
// unregisterRunner unregisters the runner from GitHub Actions by name.
//
// This function returns: