Skip to content

Commit

Permalink
overlay: record if using mount_program
Browse files Browse the repository at this point in the history
track if if the storage was created using a mount_program.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Mar 5, 2021
1 parent a8a9a7b commit 27903e9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func hasVolatileOption(opts []string) bool {
return false
}

func getMountProgramFlagFile(path string) string {
return filepath.Join(path, ".has-mount-program")
}

func checkSupportVolatile(home, runhome string) (bool, error) {
feature := fmt.Sprintf("volatile")
volatileCacheResult, _, err := cachedFeatureCheck(runhome, feature)
Expand Down Expand Up @@ -230,8 +234,13 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
backingFs = fsName
}

// check if they are running over btrfs, aufs, zfs, overlay, or ecryptfs
if opts.mountProgram == "" {
if opts.mountProgram != "" {
f, err := os.Create(getMountProgramFlagFile(home))
if err == nil {
f.Close()
}
} else {
// check if they are running over btrfs, aufs, zfs, overlay, or ecryptfs
if opts.forceMask != nil {
return nil, errors.New("'force_mask' is supported only with 'mount_program'")
}
Expand Down

0 comments on commit 27903e9

Please sign in to comment.