From 284b2a1313c2ee1fefbbebab7394bdc68e655099 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Mon, 4 Feb 2019 15:44:53 +0100 Subject: [PATCH] Merge existing image credentials into a fresh set With the previous merging strategy the set of credentials which got mutated could be assigned to other images, resulting in overwrites where we would (and did) not expect them. This new approach is the most direct fix to work around mutating the credentials of other images. It creates a fresh set of (empty) credentials and merges the others into it before assigning it to the image. --- cluster/kubernetes/images.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cluster/kubernetes/images.go b/cluster/kubernetes/images.go index 059f9c6c4..acea81cce 100644 --- a/cluster/kubernetes/images.go +++ b/cluster/kubernetes/images.go @@ -152,7 +152,10 @@ func (c *Cluster) ImagesToFetch() registry.ImageCreds { for imageID, creds := range imageCreds { existingCreds, ok := allImageCreds[imageID] if ok { - existingCreds.Merge(creds) + mergedCreds := registry.NoCredentials() + mergedCreds.Merge(existingCreds) + mergedCreds.Merge(creds) + allImageCreds[imageID] = mergedCreds } else { allImageCreds[imageID] = creds }