removed deprecated fields from Drain structs and API

node drain: use msgtype on txn so that events are emitted
wip: encoding extension to add Node.Drain field back to API responses

new approach for hiding Node.SecretID in the API, using `json` tag
documented this approach in the contributing guide
refactored the JSON handlers with extensions
modified event stream encoding to use the go-msgpack encoders with the extensions
This commit is contained in:
Chris Baker
2021-02-11 15:40:59 +00:00
parent 7c7569674c
commit 93d5187e7b
26 changed files with 147 additions and 264 deletions

View File

@@ -284,11 +284,9 @@ func TestHTTP_NodeDrain(t *testing.T) {
out, err := state.NodeByID(nil, node.ID)
require.Nil(err)
// the node must either be in drain mode or in elligible
// the node must either be in drain mode or ineligible
// once the node is recognize as not having any running allocs
if out.Drain {
require.True(out.Drain)
require.NotNil(out.DrainStrategy)
if out.DrainStrategy != nil {
require.Equal(10*time.Second, out.DrainStrategy.Deadline)
} else {
require.Equal(structs.NodeSchedulingIneligible, out.SchedulingEligibility)
@@ -307,7 +305,6 @@ func TestHTTP_NodeDrain(t *testing.T) {
out, err = state.NodeByID(nil, node.ID)
require.Nil(err)
require.False(out.Drain)
require.Nil(out.DrainStrategy)
})
}