mirror of https://github.com/k3s-io/k3s
Merge pull request #2784 from MonzElmasry/etcd-dir
change etcd dir permission if it existspull/2800/head
commit
5d6255df61
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue