plugins device: remove trace level containing config contents

This commit is contained in:
Lang Martin
2019-10-30 14:29:35 -04:00
committed by Lang Martin
parent 4886bdf7e8
commit 6aff18dcd0

View File

@@ -22,7 +22,6 @@ import (
"github.com/hashicorp/nomad/plugins/device"
"github.com/kr/pretty"
"github.com/mitchellh/cli"
"github.com/zclconf/go-cty/cty/msgpack"
)
func DeviceCommandFactory(meta Meta) cli.CommandFactory {
@@ -100,8 +99,6 @@ func (c *Device) Run(args []string) int {
c.logger.Error("failed to read config file", "error", err)
return 1
}
c.logger.Trace("read config", "config", string(config))
}
// Get the plugin
@@ -173,8 +170,6 @@ func (c *Device) getSpec() (hcldec.Spec, error) {
return nil, fmt.Errorf("failed to get config schema: %v", err)
}
c.logger.Trace("device spec", "spec", hclog.Fmt("% #v", pretty.Formatter(spec)))
// Convert the schema
schema, diag := hclspecutils.Convert(spec)
if diag.HasErrors() {
@@ -195,18 +190,10 @@ func (c *Device) setConfig(spec hcldec.Spec, apiVersion string, config []byte, n
return err
}
c.logger.Trace("raw hcl config", "config", hclog.Fmt("% #v", pretty.Formatter(configVal)))
val, diag, diagErrs := hclutils.ParseHclInterface(configVal, spec, nil)
_, diag, diagErrs := hclutils.ParseHclInterface(configVal, spec, nil)
if diag.HasErrors() {
return multierror.Append(errors.New("failed to parse config: "), diagErrs...)
}
c.logger.Trace("parsed hcl config", "config", hclog.Fmt("% #v", pretty.Formatter(val)))
cdata, err := msgpack.Marshal(val, val.Type())
if err != nil {
return err
}
req := &base.Config{
PluginConfig: cdata,
@@ -214,7 +201,6 @@ func (c *Device) setConfig(spec hcldec.Spec, apiVersion string, config []byte, n
ApiVersion: apiVersion,
}
c.logger.Trace("msgpack config", "config", string(cdata))
if err := c.dev.SetConfig(req); err != nil {
return err
}