]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: rm podman-auth.json if removing last cluster
authorAdam King <adking@redhat.com>
Wed, 14 Feb 2024 17:02:09 +0000 (12:02 -0500)
committerAdam King <adking@redhat.com>
Wed, 14 Feb 2024 18:16:36 +0000 (13:16 -0500)
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>
src/cephadm/cephadm.py

index 5a7ed9e766569e0d7446fe9041eee51667d337f3..22704537e409f34e60b2e40d33cb81b6a647a1c6 100755 (executable)
@@ -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')]