Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade etcd client to v3 #1562

Merged
merged 2 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ K8S_VERSION=v1.22.3
GOARM=7

# These variables can be overridden by setting an environment variable.
TEST_PACKAGES?=pkg/ip subnet subnet/etcdv2 subnet/kube network backend
TEST_PACKAGES?=pkg/ip subnet subnet/etcd subnet/kube network backend
TEST_PACKAGES_EXPANDED=$(TEST_PACKAGES:%=github.com/flannel-io/flannel/%)
PACKAGES?=$(TEST_PACKAGES) network
PACKAGES_EXPANDED=$(PACKAGES:%=github.com/flannel-io/flannel/%)
Expand Down
2 changes: 1 addition & 1 deletion backend/route_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func routeAdd(route *netlink.Route, ipFamily int, addToRouteList, removeFromRout
// Same Dst and same Gw, keep it and do not attempt to add it.
log.Infof("Route to %v already exists, skipping.", route)
} else if err := netlink.RouteAdd(route); err != nil {
log.Errorf("Error adding route to %v", route)
log.Errorf("Error adding route to %v: %s", route, err)
return
}
_, err = netlink.RouteListFiltered(ipFamily, &netlink.Route{Dst: route.Dst}, netlink.RT_FILTER_DST)
Expand Down
10 changes: 5 additions & 5 deletions dist/functional-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ setup() {
}

teardown() {
echo "########## logs flannel-e2e-test-flannel1 for ##########" 2>&1
echo "########## logs for flannel-e2e-test-flannel1 container ##########" 2>&1
docker logs flannel-e2e-test-flannel1
docker rm -f flannel-e2e-test-flannel1 flannel-e2e-test-flannel2 flannel-e2e-test-flannel1-iperf flannel-host1 flannel-host2 > /dev/null 2>&1
docker run --rm $ETCDCTL_IMG etcdctl --endpoints=$etcd_endpt rm /coreos.com/network/config > /dev/null 2>&1
docker run --rm -e ETCDCTL_API=3 $ETCDCTL_IMG etcdctl --endpoints=$etcd_endpt rm /coreos.com/network/config > /dev/null 2>&1
}

write_config_etcd() {
Expand All @@ -59,7 +59,7 @@ write_config_etcd() {
flannel_conf="{ \"Network\": \"$FLANNEL_NET\", \"Backend\": { \"Type\": \"${backend}\" } }"
fi

while ! docker run --rm $ETCDCTL_IMG etcdctl --endpoints=$etcd_endpt set /coreos.com/network/config "$flannel_conf" >/dev/null
while ! docker run --rm -e ETCDCTL_API=3 $ETCDCTL_IMG etcdctl --endpoints=$etcd_endpt put /coreos.com/network/config "$flannel_conf" >/dev/null
do
sleep 0.1
done
Expand Down Expand Up @@ -181,12 +181,12 @@ test_multi() {
flannel_conf_vxlan='{"Network": "10.11.0.0/16", "Backend": {"Type": "vxlan"}}'
flannel_conf_host_gw='{"Network": "10.12.0.0/16", "Backend": {"Type": "host-gw"}}'

while ! docker run --rm $ETCD_IMG etcdctl --endpoints=$etcd_endpt set /vxlan/network/config "$flannel_conf_vxlan" >/dev/null
while ! docker run --rm -e ETCDCTL_API=3 $ETCD_IMG etcdctl --endpoints=$etcd_endpt put /vxlan/network/config "$flannel_conf_vxlan" >/dev/null
do
sleep 0.1
done

while ! docker run --rm $ETCD_IMG etcdctl --endpoints=$etcd_endpt set /hostgw/network/config "$flannel_conf_host_gw" >/dev/null
while ! docker run --rm -e ETCDCTL_API=3 $ETCD_IMG etcdctl --endpoints=$etcd_endpt put /hostgw/network/config "$flannel_conf_host_gw" >/dev/null
do
sleep 0.1
done
Expand Down
49 changes: 40 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ module github.com/flannel-io/flannel

go 1.17

replace (
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.2.0
google.golang.org/grpc => google.golang.org/grpc v1.29.0
)
replace github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.2.0

require (
github.com/Microsoft/hcsshim v0.9.2
Expand All @@ -20,18 +17,14 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/btree v1.0.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/joho/godotenv v0.0.0-20161216230537-726cc8b906e3
github.com/jonboulle/clockwork v0.2.2
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/soheilhy/cmux v0.1.5 // indirect
github.com/tencentcloud/tencentcloud-sdk-go v1.0.67
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
github.com/vishvananda/netlink v1.2.0-beta
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae
go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489
go.uber.org/zap v1.17.0 // indirect
golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
Expand All @@ -47,12 +40,47 @@ require (

)

require go.etcd.io/etcd/client/v3 v3.5.4

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/prometheus/client_golang v1.11.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.etcd.io/etcd/client/v2 v2.305.4 // indirect
go.etcd.io/etcd/pkg/v3 v3.5.4 // indirect
go.etcd.io/etcd/raft/v3 v3.5.4 // indirect
go.etcd.io/etcd/server/v3 v3.5.4 // indirect
go.opentelemetry.io/contrib v0.20.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 // indirect
go.opentelemetry.io/otel v0.20.0 // indirect
go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect
go.opentelemetry.io/otel/metric v0.20.0 // indirect
go.opentelemetry.io/otel/sdk v0.20.0 // indirect
go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect
go.opentelemetry.io/otel/trace v0.20.0 // indirect
go.opentelemetry.io/proto/otlp v0.7.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
)

require (
cloud.google.com/go v0.65.0 // indirect
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/Microsoft/go-winio v0.4.17 // indirect
github.com/containerd/cgroups v1.0.1 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v0.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -73,10 +101,13 @@ require (
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.etcd.io/etcd/api/v3 v3.5.4
go.etcd.io/etcd/client/pkg/v3 v3.5.4
go.etcd.io/etcd/tests/v3 v3.5.4
go.opencensus.io v0.22.4 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e // indirect
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
Expand Down
Loading