Change ownership of the output directory immediately
Otherwise if there is an error creating result.json or if the Run command failed it will remain owned by root.root and cannot be deleted via the API. Closes #204
This commit is contained in:
parent
679c8c40cd
commit
c054015440
1 changed files with 7 additions and 0 deletions
|
|
@ -119,6 +119,13 @@ func (job *Job) Run() (*store.Image, error, []error) {
|
|||
continue
|
||||
}
|
||||
|
||||
// Make sure the directory ownership is correct, even if there are errors later
|
||||
err = runCommand("chown", "_osbuild-composer:_osbuild-composer", options.Location)
|
||||
if err != nil {
|
||||
r = append(r, err)
|
||||
continue
|
||||
}
|
||||
|
||||
jobFile, err := os.Create(options.Location + "/result.json")
|
||||
if err != nil {
|
||||
r = append(r, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue