Merge pull request #95229 from aojea/sourcelb

e2e can't use both pod.Name and pod.GenerateName
This commit is contained in:
Kubernetes Prow Robot 2020-10-01 07:00:54 -07:00 committed by GitHub
commit 1b4fa94c21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -456,7 +456,9 @@ func NewExecPodSpec(ns, name string, hostNetwork bool) *v1.Pod {
// newExecPodSpec returns the pod spec of exec pod
func newExecPodSpec(ns, generateName string) *v1.Pod {
pod := NewAgnhostPod(ns, "agnhost-pod", nil, nil, nil)
// GenerateName is an optional prefix, used by the server,
// to generate a unique name ONLY IF the Name field has not been provided
pod := NewAgnhostPod(ns, "", nil, nil, nil)
pod.ObjectMeta.GenerateName = generateName
return pod
}