Merge pull request #26264 from Luap99/kube-empty-alias

play kube: never add empty alias
This commit is contained in:
openshift-merge-bot[bot] 2025-06-02 18:26:49 +00:00 committed by GitHub
commit 87eeb3cf38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -890,7 +890,9 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
// the podName appended to it, but this is a breaking change and will be done in podman 5.0
ctrNameAliases := make([]string, 0, len(podYAML.Spec.Containers))
for _, container := range podYAML.Spec.Containers {
ctrNameAliases = append(ctrNameAliases, container.Name)
if container.Name != "" {
ctrNameAliases = append(ctrNameAliases, container.Name)
}
}
for k, v := range podSpec.PodSpecGen.Networks {
v.Aliases = append(v.Aliases, ctrNameAliases...)