]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: fix placement_spec_to_node_selector
authorJoseph Sawaya <jsawaya@redhat.com>
Wed, 22 Sep 2021 20:49:56 +0000 (16:49 -0400)
committerJoseph Sawaya <jsawaya@redhat.com>
Mon, 27 Sep 2021 18:52:59 +0000 (14:52 -0400)
This commit takes care of the edge case where a completely empty
placement spec is passed to the function.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
src/pybind/mgr/rook/rook_cluster.py

index 486409354178847bac3308b568fd21f36cc0e6e3..ac66d7dc91070eeb57cbcc89a059b81f06f960ae 100644 (file)
@@ -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",