Merge pull request #2784 from MonzElmasry/etcd-dir

change etcd dir permission if it exists
pull/2800/head
Menna Elmasry 2021-01-09 00:45:09 +02:00 committed by GitHub
commit 5d6255df61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -219,6 +219,17 @@ func (e *ETCD) Start(ctx context.Context, clientAccessInfo *clientaccess.Info) e
go e.manageLearners(ctx) go e.manageLearners(ctx)
if existingCluster { if existingCluster {
//check etcd dir permission
etcdDir := etcdDBDir(e.config)
info, err := os.Stat(etcdDir)
if err != nil {
return err
}
if info.Mode() != 0700 {
if err := os.Chmod(etcdDir, 0700); err != nil {
return err
}
}
opt, err := executor.CurrentETCDOptions() opt, err := executor.CurrentETCDOptions()
if err != nil { if err != nil {
return err return err