mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Retry namespace creation for e2e tests
This commit is contained in:
parent
9fa8ef2a31
commit
59ee8c24ea
@ -364,12 +364,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