You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what should be investigated or refactored
There are a couple of places in the code base where os.Chdir is used to access files in specific paths. Change of working directory is done temporarily in a function. Usually in the function the working directory is changed back in a deferred function. This is not a thread safe operation as setting the working directory is a per process system call. Packager and other components should support being used in multiple goroutines. For this reason we need to remove any use of os.Chdir.
Describe what should be investigated or refactored
There are a couple of places in the code base where os.Chdir is used to access files in specific paths. Change of working directory is done temporarily in a function. Usually in the function the working directory is changed back in a deferred function. This is not a thread safe operation as setting the working directory is a per process system call. Packager and other components should support being used in multiple goroutines. For this reason we need to remove any use of os.Chdir.
Links to any relevant code
https://github.com/defenseunicorns/zarf/blob/601a282c78701bb039924c6c72802690656395df/src/pkg/packager/publish.go#L51
https://github.com/defenseunicorns/zarf/blob/601a282c78701bb039924c6c72802690656395df/src/pkg/packager/dev.go#L37
Additional context
N/A
The text was updated successfully, but these errors were encountered: