mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Merge pull request #2784 from MonzElmasry/etcd-dir
change etcd dir permission if it exists
This commit is contained in:
commit
5d6255df61
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user