Skip to content

Commit

Permalink
Fix snapshot directory permission
Browse files Browse the repository at this point in the history
Missing executable bit for owner of snapshot directory prevented
creating snapshot files.
  • Loading branch information
michalskalski authored and Quentin-M committed Jul 25, 2022
1 parent d1a5e80 commit e152581
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/providers/snapshot/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import (
"github.com/quentin-m/etcd-cloud-operator/pkg/providers/snapshot"
)

const filePermissions = 0600
const (
filePermissions = 0600
directoryPermission = 0700
)

func init() {
snapshot.Register("file", &file{})
Expand All @@ -48,7 +51,7 @@ func (f *file) Configure(providerConfig snapshot.Config) error {
if err := providers.ParseParams(providerConfig.Params, &f.config); err != nil {
return fmt.Errorf("invalid configuration: %v", err)
}
if err := os.MkdirAll(f.config.Dir, filePermissions); err != nil {
if err := os.MkdirAll(f.config.Dir, directoryPermission); err != nil {
return fmt.Errorf("invalid configuration: failed to create directory %q: %v", f.config.Dir, err)
}
return nil
Expand Down

0 comments on commit e152581

Please sign in to comment.