"addr" is the result of net.JoinHostPort which supports IPv6 address.
Rather than ranging "tp.Endpoints" again, it's better to reuse
"addr" in the first loop to collect "eps".
See #7942 and #7943 for context.
Signed-off-by: Jes Cok <xigua67damn@gmail.com>
This patch modernizes the for-range-loop code to copy a map with
"maps.Clone" and "maps.Copy", also eliminates "copyFloats" with
"slices.Clone".
Also simplify "aggSort" and "sortMap" with slices and maps functions.
Signed-off-by: Jes Cok <xigua67damn@gmail.com>
formatAddr is just like net.JoinHostPort, I think we can use net.JoinHostPort
directly, it's simpler and clearer.
Signed-off-by: Jes Cok <xigua67damn@gmail.com>
Add two separate probes, one for liveness and one for readiness. The liveness probe would check that the local individual node is up and running, or else restart the node, while the readiness probe would check that the cluster is ready to serve traffic. This would make etcd health-check fully Kubernetes API complient.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
Changed TraceKey/StartTimeKey/TokenFieldNameGRPCKey to struct{} to
follow the correct usage of context. Similar patch to #8901.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
If start grpc proxy with --resolver-prefix, memberlist will return all alive proxy nodes, when one grpc proxy node is down, it is expected to not return the down node, but it is still return
Signed-off-by: yellowzf <zzhf3311@163.com>
Goroutine for new directors would live past director scope. Tests
could occassionally fail if this goroutine had log events after
test execution should have ended.
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>