api: postContainersStop, postContainersRestart remove redundant validation
Both of these pass the signal to daemon.containerStop(), which already validates
the signal; 2ed904cad7/daemon/stop.go (L48-L52)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2ed904cad7
commit
789223f2dc
1 changed files with 2 additions and 12 deletions
|
@ -226,12 +226,7 @@ func (s *containerRouter) postContainersStop(ctx context.Context, w http.Respons
|
|||
version = httputils.VersionFromContext(ctx)
|
||||
)
|
||||
if versions.GreaterThanOrEqualTo(version, "1.42") {
|
||||
if sig := r.Form.Get("signal"); sig != "" {
|
||||
if _, err := signal.ParseSignal(sig); err != nil {
|
||||
return errdefs.InvalidParameter(err)
|
||||
}
|
||||
options.Signal = sig
|
||||
}
|
||||
options.Signal = r.Form.Get("signal")
|
||||
}
|
||||
if tmpSeconds := r.Form.Get("t"); tmpSeconds != "" {
|
||||
valSeconds, err := strconv.Atoi(tmpSeconds)
|
||||
|
@ -294,12 +289,7 @@ func (s *containerRouter) postContainersRestart(ctx context.Context, w http.Resp
|
|||
version = httputils.VersionFromContext(ctx)
|
||||
)
|
||||
if versions.GreaterThanOrEqualTo(version, "1.42") {
|
||||
if sig := r.Form.Get("signal"); sig != "" {
|
||||
if _, err := signal.ParseSignal(sig); err != nil {
|
||||
return errdefs.InvalidParameter(err)
|
||||
}
|
||||
options.Signal = sig
|
||||
}
|
||||
options.Signal = r.Form.Get("signal")
|
||||
}
|
||||
if tmpSeconds := r.Form.Get("t"); tmpSeconds != "" {
|
||||
valSeconds, err := strconv.Atoi(tmpSeconds)
|
||||
|
|
Loading…
Add table
Reference in a new issue