Merge pull request #44951 from votdev/issue_54215_expand_cluster

mgr/dashboard: "Please expand your cluster first" shouldn't be shown if cluster is already meaningfully running

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
This commit is contained in:
Ernesto Puerta 2022-02-15 11:58:49 +01:00 committed by GitHub
commit c28fb3165b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -5152,6 +5152,9 @@ def command_bootstrap(ctx):
logger.info('Enabling autotune for osd_memory_target')
cli(['config', 'set', 'osd', 'osd_memory_target_autotune', 'true'])
# Notify the Dashboard to show the 'Expand cluster' page on first log in.
cli(['config-key', 'set', 'mgr/dashboard/cluster/status', 'INSTALLED'])
logger.info('You can access the Ceph CLI with:\n\n'
'\tsudo %s shell --fsid %s -c %s -k %s\n' % (
sys.argv[0],

View File

@ -12,7 +12,12 @@ class ClusterModel:
status: Status
def __init__(self, status=Status.INSTALLED.name):
def __init__(self, status=Status.POST_INSTALLED.name):
"""
:param status: The status of the cluster. Assume that the cluster
is already functional by default.
:type status: str
"""
self.status = self.Status[status]
def dict(self):
@ -23,4 +28,8 @@ class ClusterModel:
@classmethod
def from_db(cls):
return cls(status=mgr.get_store('cluster/status', cls.Status.INSTALLED.name))
"""
Get the stored cluster status from the configuration key/value store.
If the status is not set, assume it is already fully functional.
"""
return cls(status=mgr.get_store('cluster/status', cls.Status.POST_INSTALLED.name))