Skip to content

Commit

Permalink
bugfix: create container with invalid name
Browse files Browse the repository at this point in the history
Signed-off-by: Lang Chi <21860405@zju.edu.cn>
  • Loading branch information
lang710 authored and chilang committed Aug 18, 2020
1 parent 05026d0 commit edb10aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions daemon/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ const (
ValidNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]`
)

// ValidNamePattern is a regular expression to validate names against the collection of restricted characters.
var ValidNamePattern = regexp.MustCompile(`^/?` + ValidNameChars + `+$`)

var (
// ErrConflictContainerNetworkAndLinks conflict between --net=container and links
ErrConflictContainerNetworkAndLinks = fmt.Errorf("Conflicting options: container type network can't be used with links. This would result in undefined behavior")
Expand Down Expand Up @@ -71,6 +68,9 @@ var (
ErrConflictUTSHostname = fmt.Errorf("Conflicting options: hostname and the UTS mode")
)

// ValidNamePattern is a regular expression to validate names against the collection of restricted characters.
var ValidNamePattern = regexp.MustCompile(`^/?` + ValidNameChars + `+$`)

// Config refers to daemon's whole configurations.
type Config struct {
sync.Mutex `json:"-"`
Expand Down

0 comments on commit edb10aa

Please sign in to comment.