mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 22:05:59 +00:00
Merge pull request #9409 from lavalamp/e2eTestFix
switch to generateName for namespace creation
This commit is contained in:
commit
547b3a7ef2
@ -45,7 +45,6 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
|
||||||
|
|
||||||
"code.google.com/p/go-uuid/uuid"
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
|
|
||||||
@ -347,19 +346,19 @@ func waitForPersistentVolumePhase(phase api.PersistentVolumePhase, c *client.Cli
|
|||||||
func createTestingNS(baseName string, c *client.Client) (*api.Namespace, error) {
|
func createTestingNS(baseName string, c *client.Client) (*api.Namespace, error) {
|
||||||
namespaceObj := &api.Namespace{
|
namespaceObj := &api.Namespace{
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: fmt.Sprintf("e2e-tests-%v-%v", baseName, uuid.New()),
|
GenerateName: fmt.Sprintf("e2e-tests-%v-", baseName),
|
||||||
Namespace: "",
|
Namespace: "",
|
||||||
},
|
},
|
||||||
Status: api.NamespaceStatus{},
|
Status: api.NamespaceStatus{},
|
||||||
}
|
}
|
||||||
_, err := c.Namespaces().Create(namespaceObj)
|
got, err := c.Namespaces().Create(namespaceObj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return namespaceObj, err
|
return got, err
|
||||||
}
|
}
|
||||||
if err := waitForDefaultServiceAccountInNamespace(c, namespaceObj.Name); err != nil {
|
if err := waitForDefaultServiceAccountInNamespace(c, got.Name); err != nil {
|
||||||
return namespaceObj, err
|
return got, err
|
||||||
}
|
}
|
||||||
return namespaceObj, nil
|
return got, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func waitForPodRunningInNamespace(c *client.Client, podName string, namespace string) error {
|
func waitForPodRunningInNamespace(c *client.Client, podName string, namespace string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user