Remove k8s.io/kubernetes dependency
This commit is contained in:
parent
a762d8a4e3
commit
a85e53f4cb
8 changed files with 86 additions and 234 deletions
|
|
@ -34,7 +34,6 @@ import (
|
|||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/kubernetes/pkg/kubelet/util/sliceutils"
|
||||
|
||||
"k8s.io/ingress-nginx/internal/ingress"
|
||||
"k8s.io/ingress-nginx/internal/k8s"
|
||||
|
|
@ -208,7 +207,7 @@ func (s *statusSync) runningAddresses() ([]string, error) {
|
|||
}
|
||||
|
||||
name := k8s.GetNodeIPOrName(s.Client, pod.Spec.NodeName, s.UseNodeInternalIP)
|
||||
if !sliceutils.StringInSlice(name, addrs) {
|
||||
if !stringInSlice(name, addrs) {
|
||||
addrs = append(addrs, name)
|
||||
}
|
||||
}
|
||||
|
|
@ -365,3 +364,14 @@ func statusAddressFromService(service string, kubeClient clientset.Interface) ([
|
|||
|
||||
return nil, fmt.Errorf("unable to extract IP address/es from service %v", service)
|
||||
}
|
||||
|
||||
// stringInSlice returns true if s is in list
|
||||
func stringInSlice(s string, list []string) bool {
|
||||
for _, v := range list {
|
||||
if v == s {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue