Skip to content

Commit

Permalink
client: deprecate loading plugins without config (#19189)
Browse files Browse the repository at this point in the history
Nomad load all plugins from `plugin_dir` regardless if it is listed in
the agent configuration file. This can cause unexpected binaries to be
executed.

This commit begins the deprecation process of this behaviour. The Nomad
agent will emit a warning log for every plugin binary found without a
corresponding agent configuration block.

---------

Co-authored-by: Michael Schurter <[email protected]>
  • Loading branch information
lgfa29 and schmichael authored Nov 28, 2023
1 parent 5ff6cce commit e0cea41
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/19189.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:deprecation
config: Loading plugins from `plugin_dir` without a `plugin` configuration block is deprecated
```
6 changes: 5 additions & 1 deletion helper/pluginutils/loader/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ func (l *PluginLoader) fingerprintPlugins(plugins []os.FileInfo, configs map[str
fingerprinted := make(map[PluginID]*pluginInfo, len(plugins))
for _, p := range plugins {
name := cleanPluginExecutable(p.Name())
c := configs[name]
c, ok := configs[name]
if !ok {
// COMPAT(1.7): Skip executing unconfigured plugins in 1.8 or later.
l.logger.Warn("plugin not referenced in the agent configuration file, future versions of Nomad will not load this plugin until the agent configuration is updated", "plugin", name)
}
info, err := l.fingerprintPlugin(p, c)
if err != nil {
l.logger.Error("failed to fingerprint plugin", "plugin", name, "error", err)
Expand Down
7 changes: 7 additions & 0 deletions website/content/docs/upgrade/upgrade-specific.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ onto the same client when they are in different namespaces. To prevent this,
consider using [node pools] and constrain the jobs with a [`distinct_property`][]
constraint over [`${node.pool}`][node_attributes].

#### Loading Binaries from `plugin_dir` Without Configuration

Starting with Nomad 1.7.0, loading plugins that are not referenced in the agent
configuration file is deprecated. Future versions of Nomad will only load
plugins that have a corresponding [`plugin`](/nomad/docs/configuration/plugin)
block in the agent configuration file.

## Nomad 1.6.0

#### Enterprise License Validation with BuildDate
Expand Down

0 comments on commit e0cea41

Please sign in to comment.