Validate hostname starting from 1.24 API.

In order to keep a little bit of "sanity" on the API side, validate
hostname only starting from v1.24 API version.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester
2016-07-06 09:13:59 +02:00
parent ad44f49470
commit 6daf3d2a78
13 changed files with 44 additions and 32 deletions

View File

@@ -7,10 +7,10 @@ import (
)
// ContainerUpdate updates configuration of the container
func (daemon *Daemon) ContainerUpdate(name string, hostConfig *container.HostConfig) ([]string, error) {
func (daemon *Daemon) ContainerUpdate(name string, hostConfig *container.HostConfig, validateHostname bool) ([]string, error) {
var warnings []string
warnings, err := daemon.verifyContainerSettings(hostConfig, nil, true)
warnings, err := daemon.verifyContainerSettings(hostConfig, nil, true, validateHostname)
if err != nil {
return warnings, err
}