From 86e470fe3a88e1ee9876340d7b20fc24d41ff0da Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 1 Jan 2025 22:07:53 +0100 Subject: [PATCH] daemon/names: use lazyregexp Signed-off-by: Sebastiaan van Stijn --- daemon/names/names.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/names/names.go b/daemon/names/names.go index 22bba53d69..7b693c8fcf 100644 --- a/daemon/names/names.go +++ b/daemon/names/names.go @@ -1,9 +1,9 @@ package names // import "github.com/docker/docker/daemon/names" -import "regexp" +import "github.com/docker/docker/internal/lazyregexp" // RestrictedNameChars collects the characters allowed to represent a name, normally used to validate container and volume names. const RestrictedNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]` // RestrictedNamePattern is a regular expression to validate names against the collection of restricted characters. -var RestrictedNamePattern = regexp.MustCompile(`^` + RestrictedNameChars + `+$`) +var RestrictedNamePattern = lazyregexp.New(`^` + RestrictedNameChars + `+$`)