Skip to content

Commit 87eeb3c

Browse files
Merge pull request #26264 from Luap99/kube-empty-alias
play kube: never add empty alias
2 parents 746cbf1 + da95bbd commit 87eeb3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/domain/infra/abi/play.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,9 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
890890
// the podName appended to it, but this is a breaking change and will be done in podman 5.0
891891
ctrNameAliases := make([]string, 0, len(podYAML.Spec.Containers))
892892
for _, container := range podYAML.Spec.Containers {
893-
ctrNameAliases = append(ctrNameAliases, container.Name)
893+
if container.Name != "" {
894+
ctrNameAliases = append(ctrNameAliases, container.Name)
895+
}
894896
}
895897
for k, v := range podSpec.PodSpecGen.Networks {
896898
v.Aliases = append(v.Aliases, ctrNameAliases...)

0 commit comments

Comments
 (0)