Skip to content

Conversation

elee1766
Copy link
Contributor

since only one instance of the cobra root command exists in production branch, this means that only one copy of the caddy app can be running within a process at a time. along with that, a run of the command leaves command state dirty, which could have unintended consequences.

this is a major problem in being able to properly test caddy through the command wrapper.

in general - having such global state is a code smell, and we should strive to remove them from the codebase when possible

@francislavoie francislavoie changed the title Use a factory to create the caddy root command cmd: Use a factory to create the caddy root command Aug 22, 2024
@francislavoie francislavoie enabled auto-merge (squash) August 22, 2024 03:26
@francislavoie francislavoie merged commit 8ccfedf into caddyserver:master Aug 22, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants