Skip to content

Commit

Permalink
mgr/cephadm: check version in upgrade check
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/50784

Signed-off-by: Adam King <adking@redhat.com>
  • Loading branch information
adk3798 committed May 13, 2021
1 parent 8eeca6e commit e1979fb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pybind/mgr/cephadm/module.py
Expand Up @@ -2389,6 +2389,16 @@ def upgrade_check(self, image: str, version: str) -> str:
raise OrchestratorError('must specify either image or version')

image_info = CephadmServe(self)._get_container_image_info(target_name)

ceph_image_version = image_info.ceph_version
if not ceph_image_version:
return f'Unable to extract ceph version from {target_name}.'
if ceph_image_version.startswith('ceph version '):
ceph_image_version = ceph_image_version.split(' ')[2]
version_error = self.upgrade._check_target_version(ceph_image_version)
if version_error:
return f'Incompatible upgrade: {version_error}'

self.log.debug(f'image info {image} -> {image_info}')
r: dict = {
'target_name': target_name,
Expand Down

0 comments on commit e1979fb

Please sign in to comment.