use versioned api in kube-proxy

This commit is contained in:
x00416946 fisherxu
2018-08-15 21:51:19 +08:00
committed by fisherxu
parent c582a37cae
commit 79e17e6cd7
31 changed files with 1482 additions and 1513 deletions

View File

@@ -24,8 +24,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/tools/record"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core/helper"
helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
utilnet "k8s.io/kubernetes/pkg/util/net"
"github.com/golang/glog"
@@ -60,14 +59,14 @@ func IsLocalIP(ip string) (bool, error) {
return false, nil
}
func ShouldSkipService(svcName types.NamespacedName, service *api.Service) bool {
func ShouldSkipService(svcName types.NamespacedName, service *v1.Service) bool {
// if ClusterIP is "None" or empty, skip proxying
if !helper.IsServiceIPSet(service) {
glog.V(3).Infof("Skipping service %s due to clusterIP = %q", svcName, service.Spec.ClusterIP)
return true
}
// Even if ClusterIP is set, ServiceTypeExternalName services don't get proxied
if service.Spec.Type == api.ServiceTypeExternalName {
if service.Spec.Type == v1.ServiceTypeExternalName {
glog.V(3).Infof("Skipping service %s due to Type=ExternalName", svcName)
return true
}