Merge pull request #1435 from harche/id_regex

Issue #1429 : Removing check for id string length
This commit is contained in:
Daniel, Dao Quang Minh 2017-05-04 15:45:02 -05:00 committed by GitHub
commit 7ffea268d3
1 changed files with 2 additions and 7 deletions

View File

@ -27,10 +27,7 @@ const (
execFifoFilename = "exec.fifo"
)
var (
idRegex = regexp.MustCompile(`^[\w+-\.]+$`)
maxIdLen = 1024
)
var idRegex = regexp.MustCompile(`^[\w+-\.]+$`)
// InitArgs returns an options func to configure a LinuxFactory with the
// provided init binary path and arguments.
@ -330,8 +327,6 @@ func (l *LinuxFactory) validateID(id string) error {
if !idRegex.MatchString(id) {
return newGenericError(fmt.Errorf("invalid id format: %v", id), InvalidIdFormat)
}
if len(id) > maxIdLen {
return newGenericError(fmt.Errorf("invalid id format: %v", id), InvalidIdFormat)
}
return nil
}