From c792c5a3532e00b64b476e54e6758e5f4910b841 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 26 Feb 2019 14:53:45 -0500 Subject: [PATCH] mgr/orchestrator: just keep a single count value in StatelessServiceSpec We currently have a min_size/max_size values in here, but we don't have any orchestrators that can take advantage of two values. Let's just keep a simple count for now, until we do. Signed-off-by: Jeff Layton --- src/pybind/mgr/orchestrator.py | 5 ++--- src/pybind/mgr/rook/rook_cluster.py | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index abfd321b089..1f3e8f2782b 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -658,9 +658,8 @@ class StatelessServiceSpec(object): # within one ceph cluster. self.name = "" - # Minimum and maximum number of service instances - self.min_size = 1 - self.max_size = 1 + # Count of service instances + self.count = 1 # Arbitrary JSON-serializable object. # Maybe you're using e.g. kubenetes and you want to pass through diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index f42b95a0b5d..b180dcfb30e 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -209,7 +209,6 @@ class RookCluster(object): def add_filesystem(self, spec): # TODO use spec.placement - # TODO use spec.min_size (and use max_size meaningfully) # TODO warn if spec.extended has entries we don't kow how # to action. @@ -223,7 +222,7 @@ class RookCluster(object): "spec": { "onlyManageDaemons": True, "metadataServer": { - "activeCount": spec.max_size, + "activeCount": spec.count, "activeStandby": True } @@ -235,7 +234,6 @@ class RookCluster(object): def add_nfsgw(self, spec): # TODO use spec.placement - # TODO use spec.min_size (and use max_size meaningfully) # TODO warn if spec.extended has entries we don't kow how # to action. @@ -251,7 +249,7 @@ class RookCluster(object): "pool": spec.extended["pool"] }, "server": { - "active": spec.max_size, + "active": spec.count, } } } @@ -263,7 +261,6 @@ class RookCluster(object): self.rook_api_post("cephnfses/", body=rook_nfsgw) def add_objectstore(self, spec): - rook_os = { "apiVersion": ROOK_API_NAME, "kind": "CephObjectStore", -- 2.39.5