Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Strip whitespace from worker types in Dockerfile-workers #14165

Merged
merged 6 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/14165.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sanitize worker list used in Docker images. Contributed by Jason Little.
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 2 additions & 4 deletions docker/configure_workers_and_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ def generate_worker_files(
# No workers, just the main process
worker_types = []
else:
# Split type names by comma
worker_types = worker_types_env.split(",")
# Split type names by comma, remove extra whitespace, sometimes it's there.
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
worker_types = [x.strip() for x in worker_types_env.split(",")]

# Create the worker configuration directory if it doesn't already exist
os.makedirs("/conf/workers", exist_ok=True)
Expand All @@ -420,8 +420,6 @@ def generate_worker_files(

# For each worker type specified by the user, create config values
for worker_type in worker_types:
worker_type = worker_type.strip()

worker_config = WORKERS_CONFIG.get(worker_type)
if worker_config:
worker_config = worker_config.copy()
Expand Down