Merge pull request #10301 from satnam6502/e2e

Retry namespace creation for e2e tests
This commit is contained in:
Alex Robinson 2015-06-29 14:32:32 -07:00
commit 450d36f7af

View File

@ -386,12 +386,21 @@ func createTestingNS(baseName string, c *client.Client) (*api.Namespace, error)
},
Status: api.NamespaceStatus{},
}
got, err := c.Namespaces().Create(namespaceObj)
if err != nil {
return got, err
// Be robust about making the namespace creation call.
var got *api.Namespace
if err := wait.Poll(poll, singleCallTimeout, func() (bool, error) {
var err error
got, err = c.Namespaces().Create(namespaceObj)
if err != nil {
return false, nil
}
return true, nil
}); err != nil {
return nil, err
}
if err := waitForDefaultServiceAccountInNamespace(c, got.Name); err != nil {
return got, err
return nil, err
}
return got, nil
}