Remap all init container images of etcd-manager

This commit is contained in:
Alasdair Tran 2023-06-18 12:51:41 +00:00
parent 75c4051116
commit 63cbe32293
1 changed files with 9 additions and 6 deletions

View File

@ -273,14 +273,17 @@ func (b *EtcdManagerBuilder) buildPod(etcdCluster kops.EtcdClusterSpec, instance
},
},
}
// Remap image via AssetBuilder
remapped, err := b.AssetBuilder.RemapImage(initContainer.Image)
if err != nil {
return nil, fmt.Errorf("unable to remap container image %q: %w", initContainer.Image, err)
}
initContainer.Image = remapped
pod.Spec.InitContainers = append(pod.Spec.InitContainers, initContainer)
}
// Remap all init container images via AssetBuilder
for i, container := range pod.Spec.InitContainers {
remapped, err := b.AssetBuilder.RemapImage(container.Image)
if err != nil {
return nil, fmt.Errorf("unable to remap init container image %q: %w", container.Image, err)
}
pod.Spec.InitContainers[i].Image = remapped
}
}
{