mirror of https://github.com/hashicorp/consul
add serviceID to leaf cert request
parent
a4312d2e6e
commit
672e181399
|
@ -1249,8 +1249,21 @@ func (s *HTTPServer) AgentConnectCALeafCert(resp http.ResponseWriter, req *http.
|
|||
// not the ID of the service instance.
|
||||
serviceName := strings.TrimPrefix(req.URL.Path, "/v1/agent/connect/ca/leaf/")
|
||||
|
||||
serviceID := serviceName
|
||||
allServices := s.agent.State.Services()
|
||||
for _, service := range allServices {
|
||||
if service.Service == serviceName {
|
||||
serviceID = service.ID
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
args := cachetype.ConnectCALeafRequest{
|
||||
Service: serviceName, // Need name not ID
|
||||
Service: serviceName, // Need name not ID
|
||||
ServiceID: serviceID,
|
||||
Datacenter: s.agent.config.Datacenter,
|
||||
Domain: s.agent.config.DNSDomain,
|
||||
NodeName: s.agent.config.NodeName,
|
||||
}
|
||||
var qOpts structs.QueryOptions
|
||||
|
||||
|
|
Loading…
Reference in New Issue