forked from hashicorp/nomad-autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins: refactor plugin architecture to reduce code repetition. (has…
…hicorp#75) This work aims to reduce the code repetition in relation to the Autoscalers plugin, but also make navigating the repo easier with an eye to the future of versioning plugin interfaces. The largest addition is the plugin manager which is responsible for launching, dispensing and providing access to the plugins from the agent. This manager is not feature complete, but provides a good basic form of central management to move forward with. The manager now uses a common base plugin interface which all plugins should implement. This is not currently embedded in the plugin interfaces (future) but allows for an easier work flow. Using the manager now also passes the agent logger to the plugins, meaning the plugins now log to the level and format set by the operator. The default config has been updated to include the nomad-apm and nomad-target plugins. This means these plugins are loaded by default without the requirement for the user to specify. It is not possible to turn these off because of the config merging, but is something to keep in mind for the future. The plugin interface declarations have been moved within the plugin directory to their own sub-dir. From a navigation sense I believe this makes sense, but also keeps the option of individual sub go-modules if we wish in the future. The split has also meant changing the default names of the nomad-local plugin, to be more descriptive and also remove duplication. This leads to nomad-apm and nomad-target. The bultin plugins have been moved within a special directory and if previously the plugin implemented two interfaces, these have been split apart. This is due to the problem with implementing a common base interface across all the plugins which includes a function like the set function. It is impossible/very hard to accommodate this setup alongside the base interface. In relation the Makefile has been updated to reflect both the additional plugin to build, and also the change in paths to build. Fully tested with internal and external plugin builds.
- Loading branch information
Showing
45 changed files
with
1,331 additions
and
795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.