Pārlūkot izejas kodu

daemon: return an InvalidParameter error when ep settings are wrong

Since v25.0 (commit ff50388), we validate endpoint settings when
containers are created, instead of doing so when containers are started.
However, a container created prior to that release would still trigger
validation error at start-time. In such case, the API returns a 500
status code because the Go error isn't wrapped into an InvalidParameter
error. This is now fixed.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit fcc651972e9865f24d31803d23d149ecfa0eaf62)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Albin Kerouanton 1 gadu atpakaļ
vecāks
revīzija
7c185a1e40
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      daemon/container_operations.go

+ 1 - 1
daemon/container_operations.go

@@ -645,7 +645,7 @@ func (daemon *Daemon) updateNetworkConfig(container *container.Container, n *lib
 	}
 
 	if err := validateEndpointSettings(n, n.Name(), endpointConfig); err != nil {
-		return err
+		return errdefs.InvalidParameter(err)
 	}
 
 	if updateSettings {