registry/etcd: fix logging nil pointer dereference (#1888)
This commit is contained in:
parent
0b73d411ad
commit
d2cea4b7b7
@ -295,14 +295,16 @@ func (e *etcdRegistry) registerNode(s *registry.Service, node *registry.Node, op
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if logger.V(logger.TraceLevel, logger.DefaultLogger) {
|
|
||||||
logger.Tracef("Registering %s id %s with lease %v and leaseID %v and ttl %v", service.Name, node.Id, lgr, lgr.ID, options.TTL)
|
|
||||||
}
|
|
||||||
|
|
||||||
// create an entry for the node
|
// create an entry for the node
|
||||||
var putOpts []clientv3.OpOption
|
var putOpts []clientv3.OpOption
|
||||||
if lgr != nil {
|
if lgr != nil {
|
||||||
putOpts = append(putOpts, clientv3.WithLease(lgr.ID))
|
putOpts = append(putOpts, clientv3.WithLease(lgr.ID))
|
||||||
|
|
||||||
|
if logger.V(logger.TraceLevel, logger.DefaultLogger) {
|
||||||
|
logger.Tracef("Registering %s id %s without lease", service.Name, node.Id)
|
||||||
|
}
|
||||||
|
} else if logger.V(logger.TraceLevel, logger.DefaultLogger) {
|
||||||
|
logger.Tracef("Registering %s id %s with lease %v and leaseID %v and ttl %v", service.Name, node.Id, lgr, lgr.ID, options.TTL)
|
||||||
}
|
}
|
||||||
|
|
||||||
key := nodePath(options.Domain, s.Name, node.Id)
|
key := nodePath(options.Domain, s.Name, node.Id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user