feat: allow specifying runtime class in runner spec (#580)

This allows using the `runtimeClassName` directive in the runner's spec.

One of the use-cases for this is Kata Containers, which use `runtimeClassName` in a pod spec as an indicator that the pod should run inside a Kata container. This allows us a greater degree of pod isolation.
This commit is contained in:
Ameer Ghani
2021-06-03 18:56:43 -05:00
committed by GitHub
parent 30ab0c0b71
commit 7523ea44f1
10 changed files with 37 additions and 1 deletions

View File

@@ -910,6 +910,10 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
pod.Spec.HostAliases = runner.Spec.HostAliases
}
if runner.Spec.RuntimeClassName != nil {
pod.Spec.RuntimeClassName = runner.Spec.RuntimeClassName
}
if err := ctrl.SetControllerReference(&runner, &pod, r.Scheme); err != nil {
return pod, err
}