Skip to content

Commit c0b8f63

Browse files
authored
Merge pull request #3724 from apostasie/bypass
Create directory for bypass4netns pid file
2 parents eed4480 + 32ab747 commit c0b8f63

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/bypass4netnsutil/bypass4netnsutil.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,14 @@ func GetPidFilePathByID(id string) (string, error) {
131131
return "", err
132132
}
133133

134-
socketPath := filepath.Join(xdgRuntimeDir, "bypass4netns", id[0:15]+".pid")
135-
return socketPath, nil
134+
pidPath := filepath.Join(xdgRuntimeDir, "bypass4netns", id[0:15]+".pid")
135+
136+
err = os.MkdirAll(filepath.Join(xdgRuntimeDir, "bypass4netns"), 0o700)
137+
if err != nil {
138+
return "", err
139+
}
140+
141+
return pidPath, nil
136142
}
137143

138144
func IsBypass4netnsEnabled(annotationsMap map[string]string) (enabled, bindEnabled bool, err error) {

0 commit comments

Comments
 (0)