Skip to content

Commit

Permalink
Merge pull request #2784 from MonzElmasry/etcd-dir
Browse files Browse the repository at this point in the history
change etcd dir permission if it exists
  • Loading branch information
MonzElmasry authored Jan 8, 2021
2 parents 3c7fd3d + 86f68d5 commit 5d6255d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ func (e *ETCD) Start(ctx context.Context, clientAccessInfo *clientaccess.Info) e
go e.manageLearners(ctx)

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()
if err != nil {
return err
Expand Down

0 comments on commit 5d6255d

Please sign in to comment.