mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user