diff --git a/pkg/operator/ceph/cluster/osd/osd.go b/pkg/operator/ceph/cluster/osd/osd.go index 7460057cb..845d55f79 100644 --- a/pkg/operator/ceph/cluster/osd/osd.go +++ b/pkg/operator/ceph/cluster/osd/osd.go @@ -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 diff --git a/pkg/operator/ceph/cluster/osd/status_test.go b/pkg/operator/ceph/cluster/osd/status_test.go index 39b237f01..6d8033046 100644 --- a/pkg/operator/ceph/cluster/osd/status_test.go +++ b/pkg/operator/ceph/cluster/osd/status_test.go @@ -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)