mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-12 20:46:47 +00:00
Use --ephemeral by default
Ref https://github.com/actions-runner-controller/actions-runner-controller/issues/1189
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user