Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: Use a factory to create the caddy root command #6533

Merged
merged 3 commits into from
Aug 22, 2024

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
cmd/commands.go Outdated Show resolved Hide resolved
@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