From c2b648e971594444928d4e4678db4f83696bdb17 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Fri, 22 Nov 2024 16:15:09 +0100 Subject: [PATCH] Allow multiple bind addresses on entrypoints Both content and api worker allow to specify --bind multiple times now. fixes #6053 --- CHANGES/6053.bugfix | 2 ++ pulpcore/app/entrypoint.py | 5 +++-- pulpcore/content/entrypoint.py | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 CHANGES/6053.bugfix diff --git a/CHANGES/6053.bugfix b/CHANGES/6053.bugfix new file mode 100644 index 0000000000..2dd7fb3483 --- /dev/null +++ b/CHANGES/6053.bugfix @@ -0,0 +1,2 @@ +Allowed to bind api and content workers to multiple addresses. +You can specify `--bind` multiple times on the `pulpcore-{api,content}` entrypoints. diff --git a/pulpcore/app/entrypoint.py b/pulpcore/app/entrypoint.py index 8a7b94b5da..bef0518027 100644 --- a/pulpcore/app/entrypoint.py +++ b/pulpcore/app/entrypoint.py @@ -102,7 +102,7 @@ def load(self): # https://github.com/benoitc/gunicorn/blob/master/gunicorn/config.py -@click.option("--bind", "-b", default="[::]:24817") +@click.option("--bind", "-b", default=["[::]:24817"], multiple=True) @click.option("--workers", "-w", type=int) # @click.option("--threads", "-w", type=int) # We don't use a threaded worker... @click.option("--name", "-n", "proc_name") @@ -136,5 +136,6 @@ def load(self): @click.option("--user", "-u") @click.option("--group", "-g") @click.command() -def main(**options): +def main(bind, **options): + options["bind"] = list(bind) PulpcoreApiApplication(options).run() diff --git a/pulpcore/content/entrypoint.py b/pulpcore/content/entrypoint.py index 5ae79cfe22..1179f782f6 100644 --- a/pulpcore/content/entrypoint.py +++ b/pulpcore/content/entrypoint.py @@ -13,7 +13,7 @@ def load(self): return pulpcore.content.server -@click.option("--bind", "-b", default="[::]:24816") +@click.option("--bind", "-b", default=["[::]:24816"], multiple=True) @click.option("--workers", "-w", type=int) # @click.option("--threads", "-w", type=int) # We don't use a threaded worker... @click.option("--name", "-n", "proc_name") @@ -40,5 +40,6 @@ def load(self): @click.option("--user", "-u") @click.option("--group", "-g") @click.command() -def main(**options): +def main(bind, **options): + options["bind"] = list(bind) PulpcoreContentApplication(options).run()