From 6a11f5a024c9446bb09958416c47ab7813448568 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Thu, 30 Jul 2015 13:34:53 -0700 Subject: [PATCH] Add image name tests around hostnames Signed-off-by: Stephen J Day --- docs/api/v2/names_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/api/v2/names_test.go b/docs/api/v2/names_test.go index 89ab9c61..656ae846 100644 --- a/docs/api/v2/names_test.go +++ b/docs/api/v2/names_test.go @@ -164,6 +164,23 @@ var ( err: ErrRepositoryNameComponentInvalid, invalid: true, }, + { + input: "b.gcr.io/test.example.com/my-app", // embedded domain component + }, + // TODO(stevvooe): The following is a punycode domain name that we may + // want to allow in the future. Currently, this is not allowed but we + // may want to change this in the future. Adding this here as invalid + // for the time being. + { + input: "xn--n3h.com/myimage", // http://☃.com in punycode + err: ErrRepositoryNameComponentInvalid, + invalid: true, + }, + { + input: "xn--7o8h.com/myimage", // http://🐳.com in punycode + err: ErrRepositoryNameComponentInvalid, + invalid: true, + }, } )