),
config_blobs=daemon_spec.final_config,
).dump_json_str(),
+ use_current_daemon_image=reconfig,
)
if daemon_spec.daemon_type == 'agent':
error_ok: Optional[bool] = False,
image: Optional[str] = "",
log_output: Optional[bool] = True,
+ use_current_daemon_image: bool = False,
) -> Any:
try:
out, err, code = await self._run_cephadm(
host, entity, command, args, no_fsid=no_fsid, error_ok=error_ok,
- image=image, log_output=log_output)
+ image=image, log_output=log_output, use_current_daemon_image=use_current_daemon_image)
if code:
raise OrchestratorError(f'host {host} `cephadm {command}` returned {code}: {err}')
except Exception as e:
env_vars: Optional[List[str]] = None,
log_output: Optional[bool] = True,
timeout: Optional[int] = None, # timeout in seconds
+ use_current_daemon_image: bool = False,
) -> Tuple[List[str], List[str], int]:
"""
Run cephadm on the remote host with the given command + args
# Skip the image check for daemons deployed that are not ceph containers
if not str(entity).startswith(bypass_image):
if not image and entity is not cephadmNoImage:
- image = self.mgr._get_container_image(entity)
+ image = self.mgr._get_container_image(
+ entity,
+ use_current_daemon_image=use_current_daemon_image
+ )
final_args = []
[host]).stdout == f"Created osd(s) 1 on host '{host}'"
assert _run_cephadm.mock_calls == [
mock.call(host, 'osd', 'ceph-volume',
- ['--', 'lvm', 'list', '--format', 'json'], no_fsid=False, error_ok=False, image='', log_output=True),
- mock.call(host, f'osd.{osd_id}', ['_orch', 'deploy'], [], stdin=mock.ANY),
+ ['--', 'lvm', 'list', '--format', 'json'],
+ no_fsid=False, error_ok=False, image='', log_output=True, use_current_daemon_image=False),
+ mock.call(host, f'osd.{osd_id}', ['_orch', 'deploy'], [], stdin=mock.ANY, use_current_daemon_image=False),
mock.call(host, 'osd', 'ceph-volume',
- ['--', 'raw', 'list', '--format', 'json'], no_fsid=False, error_ok=False, image='', log_output=True),
+ ['--', 'raw', 'list', '--format', 'json'],
+ no_fsid=False, error_ok=False, image='', log_output=True, use_current_daemon_image=False),
]
dd = cephadm_module.cache.get_daemon(f'osd.{osd_id}', host=host)
assert dd.name() == f'osd.{osd_id}'
},
},
}),
+ use_current_daemon_image=True,
)
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
"crush_location": "datacenter=a",
},
}),
+ use_current_daemon_image=False,
)
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
"keyring": "[client.crash.test]\nkey = None\n",
},
}),
+ use_current_daemon_image=False,
)
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
},
"config_blobs": {},
}),
+ use_current_daemon_image=False,
)
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
},
"config_blobs": {},
}),
+ use_current_daemon_image=False,
)
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
},
"config_blobs": {},
}),
+ use_current_daemon_image=False,
)
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
env_vars=['CEPH_VOLUME_OSDSPEC_AFFINITY=foo'], error_ok=True,
stdin='{"config": "", "keyring": ""}')
_run_cephadm.assert_any_call(
- 'test', 'osd', 'ceph-volume', ['--', 'lvm', 'list', '--format', 'json'], image='', no_fsid=False, error_ok=False, log_output=True)
+ 'test', 'osd', 'ceph-volume', ['--', 'lvm', 'list', '--format', 'json'],
+ image='', no_fsid=False, error_ok=False, log_output=True, use_current_daemon_image=False
+ )
_run_cephadm.assert_any_call(
- 'test', 'osd', 'ceph-volume', ['--', 'raw', 'list', '--format', 'json'], image='', no_fsid=False, error_ok=False, log_output=True)
+ 'test', 'osd', 'ceph-volume', ['--', 'raw', 'list', '--format', 'json'],
+ image='', no_fsid=False, error_ok=False, log_output=True, use_current_daemon_image=False
+ )
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
def test_apply_osd_save_non_collocated(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
'--no-auto', '/dev/sdb', '--db-devices', '/dev/sdc',
'--wal-devices', '/dev/sdd', '--yes', '--no-systemd'],
env_vars=['CEPH_VOLUME_OSDSPEC_AFFINITY=noncollocated'],
- error_ok=True, stdin='{"config": "", "keyring": ""}')
+ error_ok=True, stdin='{"config": "", "keyring": ""}',
+ )
_run_cephadm.assert_any_call(
- 'test', 'osd', 'ceph-volume', ['--', 'lvm', 'list', '--format', 'json'], image='', no_fsid=False, error_ok=False, log_output=True)
+ 'test', 'osd', 'ceph-volume', ['--', 'lvm', 'list', '--format', 'json'],
+ image='', no_fsid=False, error_ok=False, log_output=True, use_current_daemon_image=False
+ )
_run_cephadm.assert_any_call(
- 'test', 'osd', 'ceph-volume', ['--', 'raw', 'list', '--format', 'json'], image='', no_fsid=False, error_ok=False, log_output=True)
+ 'test', 'osd', 'ceph-volume', ['--', 'raw', 'list', '--format', 'json'],
+ image='', no_fsid=False, error_ok=False, log_output=True, use_current_daemon_image=False
+ )
@mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
@mock.patch("cephadm.module.SpecStore.save")
assert _run_cephadm.mock_calls == [
mock.call('test', 'osd', 'ceph-volume',
['--', 'inventory', '--format=json-pretty', '--filter-for-batch'], image='',
- no_fsid=False, error_ok=False, log_output=False),
+ no_fsid=False, error_ok=False, log_output=False, use_current_daemon_image=False),
mock.call('test', 'osd', 'ceph-volume',
['--', 'inventory', '--format=json-pretty'], image='',
- no_fsid=False, error_ok=False, log_output=False),
+ no_fsid=False, error_ok=False, log_output=False, use_current_daemon_image=False),
]
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
},
}
}),
+ use_current_daemon_image=False,
)
}
}
}),
+ use_current_daemon_image=False,
)
"peers": [],
}
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
'web_config': '/etc/alertmanager/web.yml',
}
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
'ip_to_bind_to': '1.2.3.1',
},
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
'web_config': '/etc/prometheus/web.yml',
},
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
},
},
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
},
},
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
"files": files,
},
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
},
"config_blobs": {},
}),
+ use_current_daemon_image=True,
)
},
"config_blobs": config,
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
},
"config_blobs": config,
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
},
"config_blobs": config,
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
},
"config_blobs": config,
}),
+ use_current_daemon_image=False,
)
},
"config_blobs": config,
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
},
"config_blobs": es_config,
}),
+ use_current_daemon_image=False,
)
with with_service(cephadm_module, collector_spec):
_run_cephadm.assert_called_with(
},
"config_blobs": collector_config,
}),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
},
"config_blobs": collector_config,
}),
+ use_current_daemon_image=False,
)
with with_service(cephadm_module, agent_spec):
_run_cephadm.assert_called_with(
},
"config_blobs": agent_config,
}),
+ use_current_daemon_image=False,
)
},
}
),
+ use_current_daemon_image=False,
)
@patch("cephadm.serve.CephadmServe._run_cephadm")
['_orch', 'deploy'],
[],
stdin=json.dumps(expected),
+ use_current_daemon_image=False,
)
['_orch', 'deploy'],
[],
stdin=json.dumps(expected),
+ use_current_daemon_image=False,
)
@patch("cephadm.module.CephadmOrchestrator.get_unique_name")
['_orch', 'deploy'],
[],
stdin=json.dumps(expected),
+ use_current_daemon_image=False,
)