Merge pull request #5297 from hashicorp/b-docker-logging

Docker: Fix logging config parsing
This commit is contained in:
Michael Schurter
2019-02-11 06:57:52 -08:00
committed by GitHub
8 changed files with 180 additions and 216 deletions

View File

@@ -10,7 +10,6 @@ import (
multierror "github.com/hashicorp/go-multierror"
plugin "github.com/hashicorp/go-plugin"
version "github.com/hashicorp/go-version"
hcl2 "github.com/hashicorp/hcl2/hcl"
"github.com/hashicorp/nomad/helper/pluginutils/hclspecutils"
"github.com/hashicorp/nomad/helper/pluginutils/hclutils"
"github.com/hashicorp/nomad/nomad/structs/config"
@@ -18,14 +17,6 @@ import (
"github.com/zclconf/go-cty/cty/msgpack"
)
var (
// configParseCtx is the context used to parse a plugin's configuration
// stanza
configParseCtx = &hcl2.EvalContext{
Functions: hclutils.GetStdlibFuncs(),
}
)
// validateConfig returns whether or not the configuration is valid
func validateConfig(config *PluginLoaderConfig) error {
var mErr multierror.Error
@@ -466,7 +457,7 @@ func (l *PluginLoader) validatePluginConfig(id PluginID, info *pluginInfo) error
}
// Parse the config using the spec
val, diag := hclutils.ParseHclInterface(info.config, spec, configParseCtx)
val, diag := hclutils.ParseHclInterface(info.config, spec, nil)
if diag.HasErrors() {
multierror.Append(&mErr, diag.Errs()...)
return multierror.Prefix(&mErr, "failed parsing config:")