functional-tester/agent: wait before loading TLS
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>release-3.4
parent
4998db4e64
commit
31a4b692ee
|
@ -275,8 +275,17 @@ func (srv *Server) saveTLSAssets() error {
|
|||
func (srv *Server) loadAutoTLSAssets() error {
|
||||
// if started with auto TLS, sends back TLS assets to tester/client
|
||||
if srv.Member.Etcd.ClientAutoTLS {
|
||||
// in case of slow disk
|
||||
time.Sleep(time.Second)
|
||||
|
||||
fdir := filepath.Join(srv.Member.Etcd.DataDir, "fixtures", "client")
|
||||
|
||||
srv.lg.Info(
|
||||
"loading client TLS assets",
|
||||
zap.String("dir", fdir),
|
||||
zap.String("endpoint", srv.EtcdClientEndpoint),
|
||||
)
|
||||
|
||||
certPath := filepath.Join(fdir, "cert.pem")
|
||||
if !fileutil.Exist(certPath) {
|
||||
return fmt.Errorf("cannot find %q", certPath)
|
||||
|
@ -306,8 +315,17 @@ func (srv *Server) loadAutoTLSAssets() error {
|
|||
)
|
||||
}
|
||||
if srv.Member.Etcd.ClientAutoTLS {
|
||||
// in case of slow disk
|
||||
time.Sleep(time.Second)
|
||||
|
||||
fdir := filepath.Join(srv.Member.Etcd.DataDir, "fixtures", "peer")
|
||||
|
||||
srv.lg.Info(
|
||||
"loading client TLS assets",
|
||||
zap.String("dir", fdir),
|
||||
zap.String("endpoint", srv.EtcdClientEndpoint),
|
||||
)
|
||||
|
||||
certPath := filepath.Join(fdir, "cert.pem")
|
||||
if !fileutil.Exist(certPath) {
|
||||
return fmt.Errorf("cannot find %q", certPath)
|
||||
|
|
Loading…
Reference in New Issue