Skip to content

Commit

Permalink
cephadm: rm podman-auth.json if removing last cluster
Browse files Browse the repository at this point in the history
We have points in rm-cluster where we check that
there are no other clusters on the host. If that
is the case, we can also clear /etc/ceph/podman-auth.json
which gets written out when we log in to a registry
while using podman

Fixes: https://tracker.ceph.com/issues/64433

Signed-off-by: Adam King <adking@redhat.com>
  • Loading branch information
adk3798 committed Feb 14, 2024
1 parent eb47ec7 commit d203a97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cephadm/cephadm.py
Expand Up @@ -4373,6 +4373,8 @@ def _rm_cluster(ctx: CephadmContext, keep_logs: bool, zap_osds: bool) -> None:
for fname in glob(f'{ctx.log_dir}/cephadm.log*'):
os.remove(fname)

unlink_file(Path('/etc/ceph/podman-auth.json'), missing_ok=True, ignore_errors=True)

# rm sysctl settings
sysctl_dirs: List[Path] = [Path(ctx.sysctl_dir), Path('/usr/lib/sysctl.d')]

Expand Down

0 comments on commit d203a97

Please sign in to comment.