k3s/pkg/etcd
Malte Starostik 389cd740c8 Fix URL pruning when joining an etcd member
* Fix URL pruning when joining an etcd member

Problem:
Existing member clientURLs were checked if they contain the joining
node's IP. In some edge cases this would prune valid URLs when the
joining IP is a substring match of the only existing member's IP.
Because of this, it was impossible to e.g. join 10.0.0.2 to an existing
node that has an IP of 10.0.0.2X or 10.0.0.2XX:

level=fatal msg="starting kubernetes: preparing server: start managed database:
joining etcd cluster: etcdclient: no available endpoints"

Solution:
Fixed by properly parsing the URLs and comparing the IPs for equality
instead of substring match.

Signed-off-by: Malte Starostik <info@stellaware.de>
(cherry picked from commit b23955e835)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-08-13 11:50:05 -07:00
..
controller.go [release-1.19] Add disable components flags (#3023) 2021-03-05 00:28:56 +02:00
etcd.go Fix URL pruning when joining an etcd member 2021-08-13 11:50:05 -07:00
etcdproxy.go [release-1.19] Add disable components flags (#3023) 2021-03-05 00:28:56 +02:00
s3.go Etcd Snapshot/Restore to/from S3 Compatible Backends (#2902) 2021-03-15 17:02:53 -07:00