mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 02:35:17 +01:00
Merge pull request #3655 from reasonerjt/scanjob-permission-fix
Fix permission issue in job_log directory
This commit is contained in:
commit
bef15d6180
@ -5,5 +5,8 @@ fi
|
|||||||
if [ -d /var/log/jobs ]; then
|
if [ -d /var/log/jobs ]; then
|
||||||
chown -R 10000:10000 /var/log/jobs/
|
chown -R 10000:10000 /var/log/jobs/
|
||||||
fi
|
fi
|
||||||
|
if [ -d /var/log/jobs/scan_job ]; then
|
||||||
|
chmod +x /var/log/jobs/scan_job
|
||||||
|
fi
|
||||||
sudo -E -u \#10000 "/harbor/harbor_jobservice"
|
sudo -E -u \#10000 "/harbor/harbor_jobservice"
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ func NewLogger(j Job) (*log.Logger, error) {
|
|||||||
logFile := j.LogPath()
|
logFile := j.LogPath()
|
||||||
d := filepath.Dir(logFile)
|
d := filepath.Dir(logFile)
|
||||||
if _, err := os.Stat(d); os.IsNotExist(err) {
|
if _, err := os.Stat(d); os.IsNotExist(err) {
|
||||||
err := os.MkdirAll(d, 0660)
|
err := os.MkdirAll(d, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Failed to create directory for log file %s, the error: %v", logFile, err)
|
log.Errorf("Failed to create directory for log file %s, the error: %v", logFile, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user