Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #15514: Remap all init container images of etcd-manager #15517

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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