mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
restored Node.Sanitize() for RPC endpoints
multiple other updates from code review
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user