1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

secrets: only try to unmount if present

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2016-10-28 17:30:22 -07:00
parent 6d12de5369
commit 643ae8b400

View file

@ -283,6 +283,14 @@ func (container *Container) SecretMount() *Mount {
// UnmountSecrets unmounts the local tmpfs for secrets // UnmountSecrets unmounts the local tmpfs for secrets
func (container *Container) UnmountSecrets() error { func (container *Container) UnmountSecrets() error {
if _, err := os.Stat(container.SecretMountPath()); err != nil {
if os.IsNotExist(err) {
return nil
} else {
return err
}
}
return detachMounted(container.SecretMountPath()) return detachMounted(container.SecretMountPath())
} }