-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
"caddy add-package", "caddy remove-package" could be idempotent #6548
Comments
I guess that makes sense. Want to submit a PR? |
I think we should just stick to idempotency for now. As mentioned in other issues, build automation with these commands isn't really intended (there are better tools for the job like xcaddy). |
Got it . Thanks @mholt for steering me . |
I wanted to confirm my understanding of this issue before I look deeper into it: To clarify the desired behavior I suspect it would still be useful to display human readable error, messages to human users in a non-idempotent fashion (indicating that no change was made), while the exit code should behave idempotently. (Indicating no error deleting something already missing, or adding something already present.) Is this the desired behavior? |
Correct @loren-osborn, see #6577 (comment) |
Looks like I should spend my time on other tasks if you already have a PR for this issue. |
agree that error codes are a key element automation. |
For idempotency, it would be useful if
caddy add-package
andcaddy remove-package
could be idempotent.caddy remove-package
, will return "Error: package is not added" if I do it twice.caddy add-package
, will return "Error: package is already added", if I do it twice.This idempotency is a nice thing in any architecture, when managing a fleet and building a fleet, because you can just store the package list somewhere and then do
add-package
without worrying if it was done in the past. Treat them like Cows, not delicate kittens :)what is the best way to handle this ?
The text was updated successfully, but these errors were encountered: