diff --git a/api/operator_autopilot.go b/api/operator_autopilot.go index 687e0121ddb1..a61ad21d611b 100644 --- a/api/operator_autopilot.go +++ b/api/operator_autopilot.go @@ -150,6 +150,9 @@ func (d *ReadableDuration) UnmarshalJSON(raw []byte) error { // AutopilotGetConfiguration is used to query the current Autopilot configuration. func (op *Operator) AutopilotGetConfiguration(q *QueryOptions) (*AutopilotConfiguration, error) { r, err := op.c.newRequest("GET", "/v1/operator/autopilot/configuration") + if err != nil { + return nil, err + } r.setQueryOptions(q) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { diff --git a/command/agent/operator_endpoint_test.go b/command/agent/operator_endpoint_test.go index 7a0a511cce3c..10ee368212d1 100644 --- a/command/agent/operator_endpoint_test.go +++ b/command/agent/operator_endpoint_test.go @@ -13,7 +13,6 @@ import ( "github.com/hashicorp/consul/testutil/retry" "github.com/hashicorp/nomad/api" "github.com/hashicorp/nomad/nomad/structs" - "github.com/pascaldekloe/goe/verify" "github.com/stretchr/testify/assert" ) @@ -262,6 +261,7 @@ func TestOperator_ServerHealth_Unhealthy(t *testing.T) { } func TestDurationFixer(t *testing.T) { + assert := assert.New(t) obj := map[string]interface{}{ "key1": []map[string]interface{}{ { @@ -301,5 +301,5 @@ func TestDurationFixer(t *testing.T) { } // Ensure we only processed the intended fieldnames - verify.Values(t, "", obj, expected) + assert.Equal(obj, expected) } diff --git a/nomad/state/autopilot.go b/nomad/state/autopilot.go index d13eb70156a8..65654ca79d92 100644 --- a/nomad/state/autopilot.go +++ b/nomad/state/autopilot.go @@ -13,7 +13,7 @@ func autopilotConfigTableSchema() *memdb.TableSchema { return &memdb.TableSchema{ Name: "autopilot-config", Indexes: map[string]*memdb.IndexSchema{ - "id": &memdb.IndexSchema{ + "id": { Name: "id", AllowMissing: true, Unique: true,