mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
hotfix: fix clone sync init no permission (#307)
This commit is contained in:
@@ -221,7 +221,7 @@ func writePIDToFile(isSudo bool) error {
|
||||
func rotateLog(l *lumberjack.Logger, isSudo bool) {
|
||||
sec := time.Duration(0)
|
||||
if isSudo {
|
||||
sec = time.Second
|
||||
sec = 2 * time.Second
|
||||
}
|
||||
for {
|
||||
nowTime := time.Now()
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
"k8s.io/kubectl/pkg/polymorphichelpers"
|
||||
"k8s.io/kubectl/pkg/util/podutils"
|
||||
"k8s.io/utils/pointer"
|
||||
"k8s.io/utils/ptr"
|
||||
|
||||
"github.com/wencaiwulue/kubevpn/v2/pkg/config"
|
||||
"github.com/wencaiwulue/kubevpn/v2/pkg/inject"
|
||||
@@ -362,6 +363,16 @@ func (d *CloneOptions) DoClone(ctx context.Context, kubeconfigJsonBytes []byte)
|
||||
MountPath: d.RemoteDir,
|
||||
},
|
||||
},
|
||||
// only for:
|
||||
// panic: mkdir /.kubevpn: permission denied │
|
||||
// │
|
||||
// goroutine 1 [running]: │
|
||||
// github.com/wencaiwulue/kubevpn/v2/pkg/config.init.1() │
|
||||
// /go/src/github.com/wencaiwulue/kubevpn/pkg/config/const.go:34 +0x1ae
|
||||
SecurityContext: &v1.SecurityContext{
|
||||
RunAsUser: ptr.To[int64](0),
|
||||
RunAsGroup: ptr.To[int64](0),
|
||||
},
|
||||
}
|
||||
spec.Spec.Containers = append(containers, *container, *containerSync)
|
||||
//set spec
|
||||
|
||||
@@ -78,12 +78,15 @@ func StartClient(ctx context.Context, localDir string, localAddr, remoteAddr str
|
||||
|
||||
var folder []config.FolderConfiguration
|
||||
folder = append(folder, config.FolderConfiguration{
|
||||
ID: dir,
|
||||
Label: label,
|
||||
FilesystemType: fs.FilesystemTypeBasic,
|
||||
Path: localDir,
|
||||
Type: config.FolderTypeSendReceive,
|
||||
Paused: false,
|
||||
ID: dir,
|
||||
Label: label,
|
||||
FilesystemType: fs.FilesystemTypeBasic,
|
||||
Path: localDir,
|
||||
Type: config.FolderTypeSendReceive,
|
||||
Paused: false,
|
||||
FSWatcherEnabled: true,
|
||||
FSWatcherDelayS: 0.01,
|
||||
RescanIntervalS: 2,
|
||||
Devices: []config.FolderDeviceConfiguration{
|
||||
{DeviceID: localID},
|
||||
{DeviceID: remoteID},
|
||||
|
||||
Reference in New Issue
Block a user