snapshot/overlay: prevent committing view
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
ca56448263
commit
1723444ba2
1 changed files with 7 additions and 0 deletions
|
@ -253,6 +253,13 @@ func (a *activeDir) setParent(name string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeDir) commit(name string, c *cache) error {
|
func (a *activeDir) commit(name string, c *cache) error {
|
||||||
|
if _, err := os.Stat(filepath.Join(a.path, "fs")); err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
return errors.New("cannot commit view")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(stevvooe): This doesn't quite meet the current model. The new model
|
// TODO(stevvooe): This doesn't quite meet the current model. The new model
|
||||||
// is to copy all of this out and let the transaction continue. We don't
|
// is to copy all of this out and let the transaction continue. We don't
|
||||||
// really have tests for it yet, but this will be the spot to fix it.
|
// really have tests for it yet, but this will be the spot to fix it.
|
||||||
|
|
Loading…
Reference in a new issue