Add ExternalName to ServiceSpec
ExternalName allows kubedns to return CNAME records for external services. No proxying is involved. See original issue at https://github.com/kubernetes/kubernetes/issues/13748 Feature tracking at https://github.com/kubernetes/features/issues/33
This commit is contained in:
@@ -4982,6 +4982,42 @@ func TestValidateService(t *testing.T) {
|
||||
},
|
||||
numErrs: 1,
|
||||
},
|
||||
{
|
||||
name: "valid ExternalName",
|
||||
tweakSvc: func(s *api.Service) {
|
||||
s.Spec.Type = api.ServiceTypeExternalName
|
||||
s.Spec.ClusterIP = ""
|
||||
s.Spec.ExternalName = "foo.bar.example.com"
|
||||
},
|
||||
numErrs: 0,
|
||||
},
|
||||
{
|
||||
name: "invalid ExternalName clusterIP (valid IP)",
|
||||
tweakSvc: func(s *api.Service) {
|
||||
s.Spec.Type = api.ServiceTypeExternalName
|
||||
s.Spec.ClusterIP = "1.2.3.4"
|
||||
s.Spec.ExternalName = "foo.bar.example.com"
|
||||
},
|
||||
numErrs: 1,
|
||||
},
|
||||
{
|
||||
name: "invalid ExternalName clusterIP (None)",
|
||||
tweakSvc: func(s *api.Service) {
|
||||
s.Spec.Type = api.ServiceTypeExternalName
|
||||
s.Spec.ClusterIP = "None"
|
||||
s.Spec.ExternalName = "foo.bar.example.com"
|
||||
},
|
||||
numErrs: 1,
|
||||
},
|
||||
{
|
||||
name: "invalid ExternalName (not a DNS name)",
|
||||
tweakSvc: func(s *api.Service) {
|
||||
s.Spec.Type = api.ServiceTypeExternalName
|
||||
s.Spec.ClusterIP = ""
|
||||
s.Spec.ExternalName = "-123"
|
||||
},
|
||||
numErrs: 1,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
Reference in New Issue
Block a user