Merge pull request #29523 from fraenkel/service_names_rfc1035

Automatic merge from submit-queue

Allow service names up to 63 characters (RFC 1035)

fixes #3752
This commit is contained in:
k8s-merge-robot
2016-08-02 10:33:16 -07:00
committed by GitHub
9 changed files with 43 additions and 43 deletions

View File

@@ -204,7 +204,7 @@ var ValidateReplicationControllerName = NameIsDNSSubdomain
// ValidateServiceName can be used to check whether the given service name is valid.
// Prefix indicates this name will be used as part of generation, in which case
// trailing dashes are allowed.
var ValidateServiceName = NameIsDNS952Label
var ValidateServiceName = NameIsDNS1035Label
// ValidateNodeName can be used to check whether the given node name is valid.
// Prefix indicates this name will be used as part of generation, in which case
@@ -258,12 +258,12 @@ func NameIsDNSLabel(name string, prefix bool) []string {
return validation.IsDNS1123Label(name)
}
// NameIsDNS952Label is a ValidateNameFunc for names that must be a DNS 952 label.
func NameIsDNS952Label(name string, prefix bool) []string {
// NameIsDNS1035Label is a ValidateNameFunc for names that must be a DNS 952 label.
func NameIsDNS1035Label(name string, prefix bool) []string {
if prefix {
name = maskTrailingDash(name)
}
return validation.IsDNS952Label(name)
return validation.IsDNS1035Label(name)
}
// Validates that given value is not negative.

View File

@@ -3449,7 +3449,7 @@ func TestValidateService(t *testing.T) {
{
name: "too long name",
tweakSvc: func(s *api.Service) {
s.Name = strings.Repeat("a", 25)
s.Name = strings.Repeat("a", 64)
},
numErrs: 1,
},
@@ -3463,7 +3463,7 @@ func TestValidateService(t *testing.T) {
{
name: "too long generateName",
tweakSvc: func(s *api.Service) {
s.GenerateName = strings.Repeat("a", 25)
s.GenerateName = strings.Repeat("a", 64)
},
numErrs: 1,
},