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:
@ -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())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user