Merge pull request #1990 from arm64b/no-valid-nodes-handling
Return error when no valid nodes available to run osd
This commit is contained in:
2 files changed
+9
No files matched your search
@@ -160,6 +160,11 @@ func (c *Cluster) Start() error {
|
||||
logger.Debugf("storage nodes: %+v", c.Storage.Nodes)
|
||||
}
|
||||
validNodes := k8sutil.GetValidNodes(c.Storage.Nodes, c.context.Clientset, c.placement)
|
||||
// no valid node is ready to run an osd
|
||||
if len(validNodes) == 0 {
|
||||
logger.Warningf("no valid node available to run an osd in namespace %s", c.Namespace)
|
||||
return nil
|
||||
}
|
||||
logger.Infof("%d of the %d storage nodes are valid", len(validNodes), len(c.Storage.Nodes))
|
||||
c.Storage.Nodes = validNodes
|
||||
// orchestrate individual nodes, starting with any that are still ongoing (in the case that we
|
||||
|
||||
@@ -60,6 +60,10 @@ func TestOrchestrationStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
func mockNodeOrchestrationCompletion(c *Cluster, nodeName string, statusMapWatcher *watch.FakeWatcher) {
|
||||
// if no valid osd node, don't need to check its status, return immediately
|
||||
if len(c.Storage.Nodes) == 0 {
|
||||
return
|
||||
}
|
||||
for {
|
||||
// wait for the node's orchestration status to change to "starting"
|
||||
cmName := fmt.Sprintf(orchestrationStatusMapName, nodeName)
|
||||
|
||||
Reference in new issue
Block a user