mirror of https://github.com/k3s-io/k3s
change etcd dir permission if it exists
Signed-off-by: MonzElmasry <menna.elmasry@rancher.com>pull/2784/head
parent
6dabf7ac61
commit
86f68d5d62
|
@ -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