Skip to content

Commit

Permalink
mgr/cephadm: enable use_repo_digest by default for pacific
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
  • Loading branch information
sebastian-philipp committed Feb 3, 2021
1 parent f6b1805 commit 1b9fcca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
@@ -1,4 +1,4 @@
tasks:
- cephadm.shell:
mon.a:
- ceph config set mgr mgr/cephadm/use_repo_digest true --force
- ceph config set mgr mgr/cephadm/use_repo_digest false --force
4 changes: 2 additions & 2 deletions src/pybind/mgr/cephadm/module.py
Expand Up @@ -311,7 +311,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
Option(
'use_repo_digest',
type='bool',
default=False,
default=True,
desc='Automatically convert image tags to image digest. Make sure all daemons use the same image',
),
]
Expand Down Expand Up @@ -357,7 +357,7 @@ def __init__(self, *args: Any, **kwargs: Any):
self.registry_url: Optional[str] = None
self.registry_username: Optional[str] = None
self.registry_password: Optional[str] = None
self.use_repo_digest = False
self.use_repo_digest = True

self._cons: Dict[str, Tuple[remoto.backends.BaseConnection,
remoto.backends.LegacyModuleExecute]] = {}
Expand Down
4 changes: 3 additions & 1 deletion src/pybind/mgr/cephadm/tests/test_cephadm.py
Expand Up @@ -947,10 +947,12 @@ def check_registry_credentials(url, username, password):
True
])
def test_upgrade_run(self, use_repo_digest, cephadm_module: CephadmOrchestrator):
cephadm_module.use_repo_digest = use_repo_digest

with with_host(cephadm_module, 'test', refresh_hosts=False):
cephadm_module.set_container_image('global', 'image')

if use_repo_digest:
cephadm_module.use_repo_digest = True

CephadmServe(cephadm_module).convert_tags_to_repo_digest()

Expand Down
3 changes: 1 addition & 2 deletions src/pybind/mgr/cephadm/tests/test_upgrade.py
Expand Up @@ -35,8 +35,7 @@ def test_upgrade_start(cephadm_module: CephadmOrchestrator):
def test_upgrade_run(use_repo_digest, cephadm_module: CephadmOrchestrator):
with with_host(cephadm_module, 'test'):
cephadm_module.set_container_image('global', 'from_image')
if use_repo_digest:
cephadm_module.use_repo_digest = True
cephadm_module.use_repo_digest = use_repo_digest
with with_service(cephadm_module, ServiceSpec('mgr'), CephadmOrchestrator.apply_mgr, 'test'):
assert wait(cephadm_module, cephadm_module.upgrade_start(
'to_image', None)) == 'Initiating upgrade to to_image'
Expand Down

0 comments on commit 1b9fcca

Please sign in to comment.