From 136c5f9c1c8ce2101cf5097a1f6326038a5efce5 Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Wed, 19 Sep 2018 10:48:02 +0100 Subject: [PATCH] Merge pull request #1372 from weaveworks/issue/1371-podcontroller-encapsulation Include initContainers in images to fetch --- cluster/kubernetes/images.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cluster/kubernetes/images.go b/cluster/kubernetes/images.go index 4f39f3412..b0436c419 100644 --- a/cluster/kubernetes/images.go +++ b/cluster/kubernetes/images.go @@ -89,6 +89,14 @@ func mergeCredentials(log func(...interface{}) error, client extendedClient, nam } imageCreds[r.Name] = creds } + for _, container := range podTemplate.Spec.InitContainers { + r, err := image.ParseRef(container.Image) + if err != nil { + log("err", err.Error()) + continue + } + imageCreds[r.Name] = creds + } } // ImagesToFetch is a k8s specific method to get a list of images to update along with their credentials