-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependencies on registry packages
Because docker core cannot vendor non-master Go dependencies, we need to remove dependencies on registry package. The definition of digest.Digest has been changed to a string and the regular expressions have been ported from docker-registry/common library. We'll likely change this be dependent on the registry in the future when the API stabilizies and use of the master branch becomes the norm. Signed-off-by: Stephen J Day <stephen.day@docker.com>
- Loading branch information
Showing
4 changed files
with
28 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package v2 | ||
|
||
import "regexp" | ||
|
||
// This file defines regular expressions for use in route definition. These | ||
// are also defined in the registry code base. Until they are in a common, | ||
// shared location, and exported, they must be repeated here. | ||
|
||
// RepositoryNameComponentRegexp restricts registtry path components names to | ||
// start with at least two letters or numbers, with following parts able to | ||
// separated by one period, dash or underscore. | ||
var RepositoryNameComponentRegexp = regexp.MustCompile(`[a-z0-9]+(?:[._-][a-z0-9]+)*`) | ||
|
||
// RepositoryNameRegexp builds on RepositoryNameComponentRegexp to allow 2 to | ||
// 5 path components, separated by a forward slash. | ||
var RepositoryNameRegexp = regexp.MustCompile(`(?:` + RepositoryNameComponentRegexp.String() + `/){1,4}` + RepositoryNameComponentRegexp.String()) | ||
|
||
// TagNameRegexp matches valid tag names. From docker/docker:graph/tags.go. | ||
var TagNameRegexp = regexp.MustCompile(`[\w][\w.-]{0,127}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters