From 79de2c5d82f7bc3702b5ff92466aabf855b10f51 Mon Sep 17 00:00:00 2001 From: Doug Borg Date: Mon, 11 Apr 2022 16:39:41 -0600 Subject: [PATCH] Only set default rootless image if it is not already customized Only change the image to the default rootless image when using the --rootless option if the image has not already customized with the --image option. Fix #938 Signed-off-by: Doug Borg --- driver/kubernetes/factory.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver/kubernetes/factory.go b/driver/kubernetes/factory.go index 42090520..a723ebda 100644 --- a/driver/kubernetes/factory.go +++ b/driver/kubernetes/factory.go @@ -108,7 +108,9 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver if err != nil { return nil, err } - deploymentOpt.Image = bkimage.DefaultRootlessImage + if _, isImage := cfg.DriverOpts["image"]; !isImage { + deploymentOpt.Image = bkimage.DefaultRootlessImage + } case "nodeselector": kvs := strings.Split(strings.Trim(v, `"`), ",") s := map[string]string{}