From cfede8c002dde2c13f754ab4cdc441746bce9b9a Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Thu, 10 Sep 2020 23:56:18 -0700 Subject: [PATCH] Make podimpersonation image configurable --- pkg/podimpersonation/podimpersonation.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/podimpersonation/podimpersonation.go b/pkg/podimpersonation/podimpersonation.go index 52a0d3c..ea50d8e 100644 --- a/pkg/podimpersonation/podimpersonation.go +++ b/pkg/podimpersonation/podimpersonation.go @@ -5,10 +5,9 @@ import ( "fmt" "time" - "github.com/rancher/wrangler/pkg/randomtoken" - "github.com/rancher/steve/pkg/stores/proxy" "github.com/rancher/wrangler/pkg/condition" + "github.com/rancher/wrangler/pkg/randomtoken" "github.com/rancher/wrangler/pkg/schemas/validation" "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" @@ -35,13 +34,15 @@ type PodImpersonation struct { roleTimeout time.Duration cg proxy.ClientGetter key string + imageName func() string } -func New(key string, cg proxy.ClientGetter, roleTimeout time.Duration) *PodImpersonation { +func New(key string, cg proxy.ClientGetter, roleTimeout time.Duration, imageName func() string) *PodImpersonation { return &PodImpersonation{ roleTimeout: roleTimeout, cg: cg, key: key, + imageName: imageName, } } @@ -510,7 +511,7 @@ func (s *PodImpersonation) augmentPod(pod *v1.Pod, sa *v1.ServiceAccount) *v1.Po pod.Spec.Containers = append(pod.Spec.Containers, v1.Container{ Name: "proxy", - Image: "ibuildthecloud/shell:v0.0.10", + Image: s.imageName(), ImagePullPolicy: v1.PullIfNotPresent, Env: []v1.EnvVar{ {