secrets: only try to unmount if present

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 643ae8b400492d47a42524124b5d41da3c37e081
Component: engine
This commit is contained in:
Evan Hazlett
2016-10-28 17:30:22 -07:00
parent bc88c956b6
commit 3d26adc9bc

View File

@ -283,6 +283,14 @@ func (container *Container) SecretMount() *Mount {
// UnmountSecrets unmounts the local tmpfs for secrets
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())
}