Make IsDNS1123Subdomain return error strings
This commit is contained in:
@@ -4691,7 +4691,7 @@ func TestValidateLimitRange(t *testing.T) {
|
||||
},
|
||||
"invalid-name": {
|
||||
api.LimitRange{ObjectMeta: api.ObjectMeta{Name: "^Invalid", Namespace: "foo"}, Spec: api.LimitRangeSpec{}},
|
||||
DNSSubdomainErrorMsg,
|
||||
"must match the regex",
|
||||
},
|
||||
"invalid-namespace": {
|
||||
api.LimitRange{ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: "^Invalid"}, Spec: api.LimitRangeSpec{}},
|
||||
@@ -5015,7 +5015,7 @@ func TestValidateResourceQuota(t *testing.T) {
|
||||
},
|
||||
"invalid Name": {
|
||||
api.ResourceQuota{ObjectMeta: api.ObjectMeta{Name: "^Invalid", Namespace: "foo"}, Spec: spec},
|
||||
DNSSubdomainErrorMsg,
|
||||
"must match the regex",
|
||||
},
|
||||
"invalid Namespace": {
|
||||
api.ResourceQuota{ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: "^Invalid"}, Spec: spec},
|
||||
@@ -5618,7 +5618,7 @@ func TestValidateEndpoints(t *testing.T) {
|
||||
"invalid name": {
|
||||
endpoints: api.Endpoints{ObjectMeta: api.ObjectMeta{Name: "-_Invliad^&Characters", Namespace: "namespace"}},
|
||||
errorType: "FieldValueInvalid",
|
||||
errorDetail: DNSSubdomainErrorMsg,
|
||||
errorDetail: "must match the regex",
|
||||
},
|
||||
"empty addresses": {
|
||||
endpoints: api.Endpoints{
|
||||
|
Reference in New Issue
Block a user