migrate autopilot implementation to raft-autopilot (#14441)

Nomad's original autopilot was importing from a private package in Consul. It
has been moved out to a shared library. Switch Nomad to use this library so that
we can eliminate the import of Consul, which is necessary to build Nomad ENT
with the current version of the Consul SDK. This also will let us pick up
autopilot improvements shared with Consul more easily.
This commit is contained in:
Tim Gross
2022-09-01 14:27:10 -04:00
committed by GitHub
parent 99ebd0ab26
commit 1815517a19
17 changed files with 450 additions and 218 deletions

View File

@@ -2,21 +2,20 @@ package agent
import (
"context"
"fmt"
"io"
"net"
"net/http"
"strings"
"fmt"
"strconv"
"strings"
"time"
"github.com/hashicorp/consul/agent/consul/autopilot"
"github.com/hashicorp/go-msgpack/codec"
"github.com/hashicorp/raft"
"github.com/hashicorp/nomad/api"
cstructs "github.com/hashicorp/nomad/client/structs"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/hashicorp/raft"
)
// OperatorRequest is used route operator/raft API requests to the implementing
@@ -184,7 +183,7 @@ func (s *HTTPServer) OperatorServerHealth(resp http.ResponseWriter, req *http.Re
return nil, nil
}
var reply autopilot.OperatorHealthReply
var reply structs.OperatorHealthReply
if err := s.agent.RPC("Operator.ServerHealth", &args, &reply); err != nil {
return nil, err
}