From 3098282c598f82e876718887cfa7a39395b76de0 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Fri, 20 Oct 2023 18:55:17 -0400 Subject: [PATCH] cephadm: add more ContainerDeamonForm methods to the keepalived class Add methods customize_{container_args,container_envs} to the keepalived daemon type class. Use those methods in the get_container function. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index ba2dc68bdd0..242f2fa35ca 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -1756,6 +1756,16 @@ class Keepalived(ContainerDaemonForm): ctr = get_container(ctx, self.identity) return to_deployment_container(ctx, ctr) + def customize_container_envs( + self, ctx: CephadmContext, envs: List[str] + ) -> None: + envs.extend(self.get_container_envs()) + + def customize_container_args( + self, ctx: CephadmContext, args: List[str] + ) -> None: + args.extend(['--cap-add=NET_ADMIN', '--cap-add=NET_RAW']) + ################################## @@ -2905,9 +2915,9 @@ def get_container( d_args.extend(haproxy.get_daemon_args()) mounts = get_container_mounts(ctx, ident) elif daemon_type == Keepalived.daemon_type: - name = ident.daemon_name - envs.extend(Keepalived.get_container_envs()) - container_args.extend(['--cap-add=NET_ADMIN', '--cap-add=NET_RAW']) + keepalived = Keepalived.create(ctx, ident) + keepalived.customize_container_envs(ctx, envs) + keepalived.customize_container_args(ctx, container_args) mounts = get_container_mounts(ctx, ident) elif daemon_type == CephNvmeof.daemon_type: nvmeof = CephNvmeof.create(ctx, ident) -- 2.39.5