From 18133de938cccd203bc29f627814fd64df69a04f Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:57:46 +0100 Subject: [PATCH] [Improvement] [ML] Extract Pod Extension (#1543) --- pkg/util/k8sutil/pods.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/util/k8sutil/pods.go b/pkg/util/k8sutil/pods.go index 7de1d559b..b65806d37 100644 --- a/pkg/util/k8sutil/pods.go +++ b/pkg/util/k8sutil/pods.go @@ -787,6 +787,16 @@ func InjectPodTemplate(spec *sharedApi.PodTemplate, pod *core.PodTemplateSpec) e return nil } +func InjectContainersTemplate(spec *sharedApi.ContainerTemplate, pod *core.PodTemplateSpec, containers ...*core.Container) error { + for _, container := range containers { + if err := InjectContainerTemplate(spec, pod, container); err != nil { + return err + } + } + + return nil +} + func InjectContainerTemplate(spec *sharedApi.ContainerTemplate, pod *core.PodTemplateSpec, container *core.Container) error { if err := InjectImageDetails(spec.GetImage(), pod, container); err != nil { return err