mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +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{},
|
Status: api.NamespaceStatus{},
|
||||||
}
|
}
|
||||||
got, err := c.Namespaces().Create(namespaceObj)
|
// 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 {
|
if err != nil {
|
||||||
return got, err
|
return false, nil
|
||||||
}
|
}
|
||||||
|
return true, nil
|
||||||
|
}); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
if err := waitForDefaultServiceAccountInNamespace(c, got.Name); err != nil {
|
if err := waitForDefaultServiceAccountInNamespace(c, got.Name); err != nil {
|
||||||
return got, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return got, nil
|
return got, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user