From 7d0bfb77e3404865c3a9b3d6cdb241a3a44b38f6 Mon Sep 17 00:00:00 2001 From: Brendan Galloway <56348696+BrendanGalloway@users.noreply.github.com> Date: Tue, 20 Oct 2020 01:43:53 +0200 Subject: [PATCH] Inject Env Vars into Runner defined Container Spec (#127) The runner token is now injected into the `runner` container defined within Runner.Spec.Containers[] --- controllers/runner_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers/runner_controller.go b/controllers/runner_controller.go index 0172b03b..7d58759a 100644 --- a/controllers/runner_controller.go +++ b/controllers/runner_controller.go @@ -382,6 +382,11 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) { if len(runner.Spec.Containers) != 0 { pod.Spec.Containers = runner.Spec.Containers + for i := 0; i < len(pod.Spec.Containers); i++ { + if pod.Spec.Containers[i].Name == containerName { + pod.Spec.Containers[i].Env = append(pod.Spec.Containers[i].Env, env...) + } + } } if len(runner.Spec.VolumeMounts) != 0 {