mirror of https://github.com/status-im/consul.git
Validation ServiceID/CheckID when deleting in deleteService() in local.go
This commit is contained in:
parent
9316596e25
commit
2df98c1824
|
@ -1,6 +1,7 @@
|
|||
package agent
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
@ -408,6 +409,10 @@ func (l *localState) syncChanges() error {
|
|||
|
||||
// deleteService is used to delete a service from the server
|
||||
func (l *localState) deleteService(id string) error {
|
||||
if id == "" {
|
||||
return fmt.Errorf("ServiceID missing")
|
||||
}
|
||||
|
||||
req := structs.DeregisterRequest{
|
||||
Datacenter: l.config.Datacenter,
|
||||
Node: l.config.NodeName,
|
||||
|
@ -425,6 +430,10 @@ func (l *localState) deleteService(id string) error {
|
|||
|
||||
// deleteCheck is used to delete a service from the server
|
||||
func (l *localState) deleteCheck(id string) error {
|
||||
if id == "" {
|
||||
return fmt.Errorf("CheckID missing")
|
||||
}
|
||||
|
||||
req := structs.DeregisterRequest{
|
||||
Datacenter: l.config.Datacenter,
|
||||
Node: l.config.NodeName,
|
||||
|
|
Loading…
Reference in New Issue