From d8a0155f7c752da98c48c6c29bb98e2a1b2125f6 Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Tue, 18 Sep 2018 17:07:48 +0100 Subject: [PATCH] Include initContainers in images to fetch Symptom: images used in initContainers, but not elsewhere, don't get metadata fetched for them, and don't get automated updates. Fix: the ImagesToFetch method of the cluster, supplied to the image DB as the way to get a list of all the images to fetch, didn't look in initContainers. So, make it do that. --- 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