Skip to content

Commit

Permalink
idp: Create parent directories if they don't exist
Browse files Browse the repository at this point in the history
The parent directories of the identifier-registration.yaml config file might
not exist when starting idp. So instead of creating just the top most
directory use MkdirAll to also create the parents.
  • Loading branch information
rhafer committed Oct 22, 2021
1 parent 46ce7b8 commit 9e8231a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/unreleased/idp-parent-dir.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Create parent directories for idp configuration

The parent directories of the identifier-registration.yaml config file might
not exist when starting idp. Create them, when that is the case.

https://github.com/owncloud/ocis/issues/2667
2 changes: 1 addition & 1 deletion idp/pkg/service/v0/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func createConfigsIfNotExist(assets http.FileSystem, filePath, ocisURL string) e

folder := path.Dir(filePath)
if _, err := os.Stat(folder); os.IsNotExist(err) {
if err := os.Mkdir(folder, 0700); err != nil {
if err := os.MkdirAll(folder, 0700); err != nil {
return err
}
}
Expand Down

0 comments on commit 9e8231a

Please sign in to comment.