summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Mulligan <jmulligan@redhat.com>2023-11-05 00:18:24 +0100
committerJohn Mulligan <jmulligan@redhat.com>2023-11-11 14:10:49 +0100
commit7817a6f4292cf283a119d7f5de57832594482e59 (patch)
tree9d4cb26afcef1a4810370c0f9f5b9722a400b188 /src
parentcephadm: add customize_container_mounts method to keepalived class (diff)
downloadceph-7817a6f4292cf283a119d7f5de57832594482e59.tar.xz
ceph-7817a6f4292cf283a119d7f5de57832594482e59.zip
cephadm: add customize_container_mounts method to haproxy class
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/cephadm/cephadm.py12
-rw-r--r--src/cephadm/tests/test_ingress.py2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py
index 83698a7f0be..0ad3bb8b019 100755
--- a/src/cephadm/cephadm.py
+++ b/src/cephadm/cephadm.py
@@ -1576,11 +1576,17 @@ class HAproxy(ContainerDaemonForm):
return extract_uid_gid(self.ctx, file_path='/var/lib')
@staticmethod
- def get_container_mounts(data_dir: str) -> Dict[str, str]:
+ def _get_container_mounts(data_dir: str) -> Dict[str, str]:
mounts = dict()
mounts[os.path.join(data_dir, 'haproxy')] = '/var/lib/haproxy'
return mounts
+ def customize_container_mounts(
+ self, ctx: CephadmContext, mounts: Dict[str, str]
+ ) -> None:
+ data_dir = self.identity.data_dir(ctx.data_dir)
+ mounts.update(self._get_container_mounts(data_dir))
+
@staticmethod
def get_sysctl_settings() -> List[str]:
return [
@@ -2698,8 +2704,8 @@ def get_container_mounts(
mounts.update(nfs_ganesha.get_container_mounts(data_dir))
if daemon_type == HAproxy.daemon_type:
- data_dir = ident.data_dir(ctx.data_dir)
- mounts.update(HAproxy.get_container_mounts(data_dir))
+ haproxy = HAproxy.create(ctx, ident)
+ haproxy.customize_container_mounts(ctx, mounts)
if daemon_type == CephNvmeof.daemon_type:
nvmeof = CephNvmeof.create(ctx, ident)
diff --git a/src/cephadm/tests/test_ingress.py b/src/cephadm/tests/test_ingress.py
index d2bb7deb6ee..7f23f64f51f 100644
--- a/src/cephadm/tests/test_ingress.py
+++ b/src/cephadm/tests/test_ingress.py
@@ -90,7 +90,7 @@ def test_haproxy_container_mounts():
good_haproxy_json(),
SAMPLE_HAPROXY_IMAGE,
)
- cmounts = hap.get_container_mounts("/var/tmp")
+ cmounts = hap._get_container_mounts("/var/tmp")
assert len(cmounts) == 1
assert cmounts["/var/tmp/haproxy"] == "/var/lib/haproxy"