Skip to content

Commit e4dfeba

Browse files
committed
disable etcd zap logs, and force etcd blocking connection
1 parent 91211d4 commit e4dfeba

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pkg/utils/etcd.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import (
2828

2929
"github.com/op/go-logging"
3030
"go.etcd.io/etcd/client/v3"
31+
"go.uber.org/zap"
32+
"google.golang.org/grpc"
3133
)
3234

3335
// State of a host.
@@ -159,6 +161,13 @@ func NewEtcdClient(config *Config, log *logging.Logger) (*Client, error) {
159161
TLS: tlsConfig,
160162
Username: config.Etcd.Username,
161163
Password: config.Etcd.Password,
164+
DialOptions: []grpc.DialOption{grpc.WithBlock()},
165+
LogConfig: &zap.Config{
166+
Level: zap.NewAtomicLevelAt(zap.ErrorLevel),
167+
Encoding: "json",
168+
OutputPaths: []string{"/dev/null"},
169+
ErrorOutputPaths: []string{"/dev/null"},
170+
},
162171
})
163172

164173
if err != nil {

test/centos-image/sshproxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ func TestMain(m *testing.M) {
940940
"gateway2:2023",
941941
"gateway2:2024",
942942
"gateway2:2025",
943-
}, time.Minute)
943+
}, 2*time.Minute)
944944
setupEtcd()
945945
os.Exit(m.Run())
946946
}

0 commit comments

Comments
 (0)