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:
parent
6d12de5369
commit
643ae8b400
1 changed files with 8 additions and 0 deletions
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue