registry/etcd: fix logging nil pointer dereference (#1889)

* registry/etcd: fix logging nil pointer dereference

* Fix stupid mistake

* Fix merge
This commit is contained in:
ben-toogood 2020-07-31 15:05:32 +01:00 committed by GitHub
parent d2cea4b7b7
commit 31ed4aa0e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -301,10 +301,10 @@ func (e *etcdRegistry) registerNode(s *registry.Service, node *registry.Node, op
putOpts = append(putOpts, clientv3.WithLease(lgr.ID)) putOpts = append(putOpts, clientv3.WithLease(lgr.ID))
if logger.V(logger.TraceLevel, logger.DefaultLogger) { if logger.V(logger.TraceLevel, logger.DefaultLogger) {
logger.Tracef("Registering %s id %s without lease", service.Name, node.Id) logger.Tracef("Registering %s id %s with lease %v and leaseID %v and ttl %v", service.Name, node.Id, lgr, lgr.ID, options.TTL)
} }
} else if logger.V(logger.TraceLevel, logger.DefaultLogger) { } 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) logger.Tracef("Registering %s id %s without lease", service.Name, node.Id)
} }
key := nodePath(options.Domain, s.Name, node.Id) key := nodePath(options.Domain, s.Name, node.Id)