mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #10301 from satnam6502/e2e
Retry namespace creation for e2e tests
This commit is contained in:
commit
450d36f7af
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user