Refine NeedsHealthCheck logic

This commit is contained in:
Zihong Zheng
2017-04-17 14:26:02 -07:00
parent cb53dbbfae
commit ae93b0da15
4 changed files with 38 additions and 18 deletions

View File

@@ -163,8 +163,7 @@ func (e *endpointsInfo) String() string {
func newServiceInfo(serviceName proxy.ServicePortName, port *api.ServicePort, service *api.Service) *serviceInfo {
onlyNodeLocalEndpoints := false
if utilfeature.DefaultFeatureGate.Enabled(features.ExternalTrafficLocalOnly) &&
(service.Spec.Type == api.ServiceTypeLoadBalancer || service.Spec.Type == api.ServiceTypeNodePort) &&
apiservice.NeedsHealthCheck(service) {
apiservice.RequestsOnlyLocalTraffic(service) {
onlyNodeLocalEndpoints = true
}
info := &serviceInfo{