From: Joseph Sawaya Date: Wed, 22 Sep 2021 20:49:56 +0000 (-0400) Subject: mgr/rook: fix placement_spec_to_node_selector X-Git-Tag: v17.1.0~781^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5ed4fbb9992e75feff5da9be7b4270232a1e0d22;p=ceph-ci.git mgr/rook: fix placement_spec_to_node_selector This commit takes care of the edge case where a completely empty placement spec is passed to the function. Signed-off-by: Joseph Sawaya --- diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index 48640935417..ac66d7dc910 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -1297,7 +1297,7 @@ def placement_spec_to_node_selector(spec: PlacementSpec, all_hosts: List) -> ccl values=ccl.CrdObjectList(host_list) ) ) - if spec.host_pattern == "*": + if spec.host_pattern == "*" or (not spec.label and not spec.hosts and not spec.host_pattern): res.matchExpressions.append( ccl.MatchExpressionsItem( key="kubernetes.io/hostname",