Skip to content

Commit 5f160f5

Browse files
committed
Update for etcd 3.4.16
Signed-off-by: Daichi Sakaue <daichi-sakaue@cybozu.co.jp>
1 parent ca58398 commit 5f160f5

36 files changed

+56
-61
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
cp ./static/resources.go /tmp/resources.go
2222
make static
2323
cmp /tmp/resources.go ./static/resources.go
24-
- run: docker run -d --network host quay.io/coreos/etcd:v3.3
24+
- run: docker run -d --network host quay.io/coreos/etcd:v3.4.16
2525
- run: make test
2626
- run: make install GOBIN=$(pwd)/docker
2727
- run: docker build -t quay.io/cybozu/cke:latest ./docker

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile for cke
22

3-
ETCD_VERSION = 3.3.25
3+
ETCD_VERSION = 3.4.16
44

55
.PHONY: all
66
all: test

agent.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func SSHAgent(node *Node, privkey string) (Agent, error) {
9393
return nil, err
9494
}
9595

96-
a := sshAgent{
96+
a := &sshAgent{
9797
node: node,
9898
client: ssh.NewClient(clientConn, channelCh, reqCh),
9999
conn: conn,
@@ -107,22 +107,22 @@ func SSHAgent(node *Node, privkey string) (Agent, error) {
107107
return a, nil
108108
}
109109

110-
func (a sshAgent) Close() error {
110+
func (a *sshAgent) Close() error {
111111
err := a.client.Close()
112112
a.client = nil
113113
return err
114114
}
115115

116-
func (a sshAgent) Run(command string) ([]byte, []byte, error) {
116+
func (a *sshAgent) Run(command string) ([]byte, []byte, error) {
117117
return a.RunWithTimeout(command, "", DefaultRunTimeout)
118118
}
119119

120-
func (a sshAgent) RunWithInput(command, input string) error {
120+
func (a *sshAgent) RunWithInput(command, input string) error {
121121
_, _, err := a.RunWithTimeout(command, input, DefaultRunTimeout)
122122
return err
123123
}
124124

125-
func (a sshAgent) RunWithTimeout(command, input string, timeout time.Duration) ([]byte, []byte, error) {
125+
func (a *sshAgent) RunWithTimeout(command, input string, timeout time.Duration) ([]byte, []byte, error) {
126126
if timeout > 0 {
127127
err := a.conn.SetDeadline(time.Now().Add(timeout))
128128
if err != nil {

docs/etcd.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ $ CERT=$(ckecli etcd root-issue)
2020
$ echo "$CERT" | jq -r .ca_certificate > /tmp/etcd-ca.crt
2121
$ echo "$CERT" | jq -r .certificate > /tmp/etcd-root.crt
2222
$ echo "$CERT" | jq -r .private_key > /tmp/etcd-root.key
23-
$ export ETCDCTL_API=3
2423
$ export ETCDCTL_CACERT=/tmp/etcd-ca.crt
2524
$ export ETCDCTL_CERT=/tmp/etcd-root.crt
2625
$ export ETCDCTL_KEY=/tmp/etcd-root.key

etcd_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"crypto/rand"
66
"encoding/hex"
77

8-
"github.com/coreos/etcd/clientv3"
98
"github.com/cybozu-go/etcdutil"
9+
"go.etcd.io/etcd/clientv3"
1010
)
1111

1212
const (

example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ $ docker ps
3939
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4040
844ea90ab7b5 quay.io/cybozu/cke:1.15 "/entrypoint.sh" 12 seconds ago Up 10 seconds cke
4141
9617f2dc36c5 quay.io/cybozu/vault:1.1 "/entrypoint.sh" 14 seconds ago Up 12 seconds 0.0.0.0:8200-8201->8200-8201/tcp vault
42-
7140fa308dc3 quay.io/cybozu/etcd:3.3 "/entrypoint.sh" 16 seconds ago Up 14 seconds 0.0.0.0:2379-2380->2379-2380/tcp etcd
42+
7140fa308dc3 quay.io/cybozu/etcd:3.4 "/entrypoint.sh" 16 seconds ago Up 14 seconds 0.0.0.0:2379-2380->2379-2380/tcp etcd
4343
```
4444

4545
## Setup node VMs

example/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ services:
5656
- /entrypoint.sh
5757
etcd:
5858
container_name: etcd
59-
image: quay.io/cybozu/etcd:3.3
59+
image: quay.io/cybozu/etcd:3.4
6060
networks:
6161
app_net:
6262
ipv4_address: 172.30.0.14

example/etcd.conf.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ initial-cluster-token: 'etcd-cluster-1'
3030
# Initial cluster state ('new' or 'existing').
3131
initial-cluster-state: 'new'
3232

33-
# Accept etcd V2 client requests
34-
enable-v2: false
35-
3633
# Enable runtime profiling data via HTTP server
3734
enable-pprof: true
3835

3936
# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
40-
log-outputs: stderr
37+
log-outputs: [stderr]

example/setup/setup.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ function retry() {
1414

1515
export VAULT_ADDR=http://172.30.0.13:8200
1616
export VAULT_TOKEN=cybozu
17-
export ETCDCTL_API=3
1817

1918
# wait for preparation of vault
2019
retry curl ${VAULT_ADDR}/v1/sys/health

example/setup/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh -e
22

3-
ETCDCTL_API=3 etcdctl --endpoints=http://172.30.0.14:2379 member list
3+
etcdctl --endpoints=http://172.30.0.14:2379 member list
44
VAULT_ADDR=http://172.30.0.13:8200 VAULT_TOKEN=cybozu vault status
55
ckecli leader

0 commit comments

Comments
 (0)