Skip to content

Commit 26c315e

Browse files
picod: remove duplicate workspace logic and avoid chdir
Signed-off-by: Aaradhy Chinche <aaradhychinche@gmail.com>
1 parent 6d4396c commit 26c315e

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

pkg/picod/files.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -422,25 +422,11 @@ func (s *Server) setWorkspace(dir string) {
422422
if !stat.IsDir() {
423423
klog.Fatalf("workspace path %q is not a directory", absDir)
424424
}
425-
426-
// Set workspace directory
427425

428426
// Set workspace directory
429427
s.workspaceDir = absDir
430428

431-
// Change process working directory to workspace
432-
if err := os.Chdir(absDir); err != nil {
433-
klog.Fatalf("failed to change working directory to %q: %v", absDir, err)
434-
}
435-
436-
klog.Infof("workspace directory initialized and working directory changed to: %q", s.workspaceDir)
437-
438-
// Change process working directory to workspace
439-
if err := os.Chdir(absDir); err != nil {
440-
klog.Fatalf("failed to change working directory to %q: %v", absDir, err)
441-
}
442-
443-
klog.Infof("workspace directory initialized and working directory changed to: %q", s.workspaceDir)
429+
klog.Infof("workspace directory initialized: %q", s.workspaceDir)
444430
}
445431

446432
// sanitizePath ensures path is within allowed scope, preventing directory traversal attacks

0 commit comments

Comments
 (0)