From: John Mulligan Date: Fri, 20 Oct 2023 22:55:17 +0000 (-0400) Subject: cephadm: add more ContainerDeamonForm methods to the keepalived class X-Git-Tag: v19.0.0~79^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3098282c598f82e876718887cfa7a39395b76de0;p=ceph.git 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 --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index ba2dc68bdd0b..242f2fa35cab 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)