Skip to content

Commit 2310748

Browse files
authored
Refactor (storage): Comment out the path validation logic (#9308)
- Comment out the error return logic for paths with "/" - Remove storage path restrictions to allow for flexible handling of root paths
1 parent 4b288a0 commit 2310748

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/op/storage.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ func CreateStorage(ctx context.Context, storage model.Storage) (uint, error) {
4747
storage.Modified = time.Now()
4848
storage.MountPath = utils.FixAndCleanPath(storage.MountPath)
4949

50-
if storage.MountPath == "/" {
51-
return 0, errors.New("Mount path cannot be '/'")
52-
}
50+
//if storage.MountPath == "/" {
51+
// return 0, errors.New("Mount path cannot be '/'")
52+
//}
5353

5454
var err error
5555
// check driver first
@@ -210,9 +210,9 @@ func UpdateStorage(ctx context.Context, storage model.Storage) error {
210210
}
211211
storage.Modified = time.Now()
212212
storage.MountPath = utils.FixAndCleanPath(storage.MountPath)
213-
if storage.MountPath == "/" {
214-
return errors.New("Mount path cannot be '/'")
215-
}
213+
//if storage.MountPath == "/" {
214+
// return errors.New("Mount path cannot be '/'")
215+
//}
216216
err = db.UpdateStorage(&storage)
217217
if err != nil {
218218
return errors.WithMessage(err, "failed update storage in database")

0 commit comments

Comments
 (0)