Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Include initContainers in images to fetch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
squaremo committed Sep 18, 2018
1 parent 48584e7 commit d8a0155
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cluster/kubernetes/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d8a0155

Please sign in to comment.