Преглед изворни кода

secrets: only try to unmount if present

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Evan Hazlett пре 8 година
родитељ
комит
643ae8b400
1 измењених фајлова са 8 додато и 0 уклоњено
  1. 8 0
      container/container_unix.go

+ 8 - 0
container/container_unix.go

@@ -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())
 }
 }