Commit Graph

34 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
fe262a3a3c chore: remove extra trailing newline 2024-02-12 21:43:45 -05:00
Jose Diaz-Gonzalez
3c6cc68086 refactor: capture output by default
This is almost certainly the correct default for Dokku. While it's a BC break and might cause an increase in memory usage, the api is mostly internal and therefore this is safe to use.
2024-02-12 20:28:31 -05:00
Jose Diaz-Gonzalez
047a3c00f5 chore: remove default false values when calling CallExecCommand 2024-02-12 20:07:43 -05:00
Jose Diaz-Gonzalez
50239b056c fix: use new CallExecCommand when checking to see how help is being called
This is part of ongoing work to remove usage of the depreated NewShellCmd.
2024-02-12 00:55:16 -05:00
Jose Diaz-Gonzalez
d55e34a55f refactor: use LogFailWithError to allow a unified exit code for golang commands when the app is missing 2021-02-28 15:20:46 -05:00
Jose Diaz-Gonzalez
d09a7506df refactor: bubble up error handling so that standard exit codes can be set at the top-level
LogFail shouldn't be called internally if at all possible.
2021-02-28 15:20:46 -05:00
Jose Diaz-Gonzalez
033b0952dd feat: allow formatting :report command output as json 2021-02-01 22:23:30 -05:00
Jose Diaz-Gonzalez
666bb9dfee fix: unscope err for report subcommands 2021-01-07 01:12:50 -05:00
Jose Diaz-Gonzalez
1439e8b30b hack: parse out the info flags for report subcommands separately
pflag doesn't ignore unspecified arguments, so they must be parsed out separately first.
2020-12-21 01:36:59 -05:00
Jose Diaz-Gonzalez
8240790381 fix: correct argument handling when setting the --app flag
When setting the `--app` flag, there was a special case for the config plugin. This plugin used to take the `--no-restart` flag as the first argument - and still did until this change - resulting in an invalid call to the plugin subcommands. What is worse is that this functionality carried over to all other plugins as they were rewritten in golang, and thus the issue spread without us knowing.

The fix is to support GNU flag parsing rules, which Golang does not do by default (Because Of Reasons™). Switching to `github.com/spf13/pflag` fixes this issue, and also allows positional arguments to be placed wherever, even in the middle of flags.

Closes #4255
2020-12-20 22:06:33 -05:00
Jose Diaz-Gonzalez
45e3623ffd refactor: switch to go mod
This hopefully makes it a little easier to work with as the tooling is now based on something in golang core.

- move columnize usage to common plugin
- remove old vendor files
2020-06-28 01:11:28 -04:00
Jose Diaz-Gonzalez
94aa67d494 feat: simplify flag parsing in resource plugin
Commands should be written such that they take arguments as is.
2020-05-29 01:59:50 -04:00
Jose Diaz-Gonzalez
8a380e52c4 feat: enable limiting and reserving gpu resources 2020-04-14 19:03:27 -04:00
Jose Diaz-Gonzalez
26e8524ae5 refactor: surface errors when running reports 2020-02-22 06:40:24 -05:00
Jose Diaz-Gonzalez
7389bb3f03 fix: properly handle returned errors 2020-02-17 20:42:29 -05:00
Jose Diaz-Gonzalez
63f4ec3867 feat: call clone/destroy prop commands as necessary 2020-02-17 19:08:39 -05:00
Jose Diaz-Gonzalez
ef7894fdfa refactor: standardize help generation 2020-02-10 00:37:00 -05:00
Jose Diaz-Gonzalez
6a7d2e5252 refactor: decrease compile time for golang plugins
This change refactors the compiled golang plugins into 3 distinct binaries:

- commands: already existing
- subcommands/subcommands: entrypoint into all subcommands
- triggers: entrypoint into all triggers

It then further symlinks triggers and subcommands to the built binaries. This results in both a much faster build process as well as smaller package size.
2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
5fd5e235d8 feat: allow omitting resource args by setting DOKKU_OMIT_RESOURCE_ARGS
This is useful for one-off containers that should have full-access to server resources.
2019-05-30 13:24:11 -04:00
Jose Diaz-Gonzalez
2aac9c71fc fix: cpu flag becomes cpus for the docker-scheduler 2019-05-17 11:59:15 -04:00
Jose Diaz-Gonzalez
603dc0fad6 fix: correct retrieval of resource values for alternative schedulers 2019-05-13 16:37:57 -04:00
Jose Diaz-Gonzalez
a4c30c2ba9 chore: standardize variable naming 2019-04-08 16:36:30 -04:00
Jose Diaz-Gonzalez
c2898ec040 feat: add trigger to allow retrieving resource properties on the fly 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
3f0126a471 fix: do not output empty arguments
Also ensure we use Printf instead of Print...
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
8db3b8e333 fix: do not barf if there are no resources specified for an application 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
00c9e5a5e9 feat: first pass at implement resource limitation on a pre-process basis 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
e8134f9c2c feat: implement resource:report 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
c9bbddcfcb refactor: drop global resource limits
Global limits make it harder to reason about the inheritance in the system. Rather than support global limits, Dokku should provide primitives to automatically set them on an app at provision time, or explicitly set them for an app. Both of these are likely best suited for a higher-level provisioner, or a community plugin.
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
04a6e30e45 refactor: drop -defaults command in favor of --global flag
This makes usage a bit simpler, at the cost of interface complexity.
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
bdfde9a481 feat: initial stub implementation for resource:*-clear commands 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
9808ecde81 feat: implement default limit management
Also add generic report information when no flags are specified
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
b36ab54b87 fix: correct variable name 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
49e44ce59b fix: correct stickler-ci issues 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
ab88dbb03d feat: Implement resource:limit and resource:reserve
Also add the install and post-delete hooks
2019-04-08 11:31:34 -04:00