restored Node.Sanitize() for RPC endpoints

multiple other updates from code review
This commit is contained in:
Chris Baker
2021-03-26 17:03:15 +00:00
parent c5731ebecc
commit a52f32dedc
23 changed files with 121 additions and 99 deletions

View File

@@ -11,7 +11,7 @@ import (
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/nomad/helper/pluginutils/hclspecutils"
"github.com/hashicorp/nomad/nomad/json/handlers"
"github.com/hashicorp/nomad/nomad/jsonhandles"
"github.com/hashicorp/nomad/plugins/drivers"
"github.com/hashicorp/nomad/plugins/shared/hclspec"
)
@@ -122,7 +122,7 @@ func JsonConfigToInterface(t *testing.T, config string) interface{} {
t.Helper()
// Decode from json
dec := codec.NewDecoderBytes([]byte(config), handlers.JsonHandle)
dec := codec.NewDecoderBytes([]byte(config), jsonhandles.JsonHandle)
var m map[string]interface{}
err := dec.Decode(&m)

View File

@@ -10,7 +10,7 @@ import (
"github.com/hashicorp/hcl/v2/hcldec"
hjson "github.com/hashicorp/hcl/v2/json"
"github.com/hashicorp/nomad/nomad/json/handlers"
"github.com/hashicorp/nomad/nomad/jsonhandles"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/function"
@@ -28,7 +28,7 @@ func ParseHclInterface(val interface{}, spec hcldec.Spec, vars map[string]cty.Va
// Encode to json
var buf bytes.Buffer
enc := codec.NewEncoder(&buf, handlers.JsonHandle)
enc := codec.NewEncoder(&buf, jsonhandles.JsonHandle)
err := enc.Encode(val)
if err != nil {
// Convert to a hcl diagnostics message