Skip to content

Commit

Permalink
Merge pull request #15517 from hakman/automated-cherry-pick-of-#15514…
Browse files Browse the repository at this point in the history
…-upstream-release-1.27

Automated cherry pick of #15514: Remap all init container images of etcd-manager
  • Loading branch information
k8s-ci-robot authored Jun 19, 2023
2 parents 1026a13 + 31fda66 commit d7f0d4d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/model/components/etcdmanager/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,16 @@ func (b *EtcdManagerBuilder) buildPod(etcdCluster kops.EtcdClusterSpec, instance
},
},
}
// Remap image via AssetBuilder
remapped, err := b.AssetBuilder.RemapImage(initContainer.Image)
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 container image %q: %w", initContainer.Image, err)
return nil, fmt.Errorf("unable to remap init container image %q: %w", container.Image, err)
}
initContainer.Image = remapped
pod.Spec.InitContainers = append(pod.Spec.InitContainers, initContainer)
pod.Spec.InitContainers[i].Image = remapped
}
}

Expand Down

0 comments on commit d7f0d4d

Please sign in to comment.