From 5ed4fbb9992e75feff5da9be7b4270232a1e0d22 Mon Sep 17 00:00:00 2001 From: Joseph Sawaya Date: Wed, 22 Sep 2021 16:49:56 -0400 Subject: [PATCH] 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 --- src/pybind/mgr/rook/rook_cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", -- 2.39.5