Commit f81e2724 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #44993 from FengyunPan/Cleanup

Automatic merge from submit-queue Cleanup storeToClusterConditionLister ClusterConditionPredicate() has been deleted, storeToClusterConditionLister will be unused.
parents 0597a85f 7d4c66c5
...@@ -13,7 +13,6 @@ go_library( ...@@ -13,7 +13,6 @@ go_library(
tags = ["automanaged"], tags = ["automanaged"],
deps = [ deps = [
"//federation/apis/federation/v1beta1:go_default_library", "//federation/apis/federation/v1beta1:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library",
], ],
) )
......
...@@ -17,7 +17,6 @@ limitations under the License. ...@@ -17,7 +17,6 @@ limitations under the License.
package cache package cache
import ( import (
"github.com/golang/glog"
kubecache "k8s.io/client-go/tools/cache" kubecache "k8s.io/client-go/tools/cache"
"k8s.io/kubernetes/federation/apis/federation/v1beta1" "k8s.io/kubernetes/federation/apis/federation/v1beta1"
) )
...@@ -34,31 +33,3 @@ func (s *StoreToClusterLister) List() (clusters v1beta1.ClusterList, err error) ...@@ -34,31 +33,3 @@ func (s *StoreToClusterLister) List() (clusters v1beta1.ClusterList, err error)
} }
return clusters, nil return clusters, nil
} }
// ClusterConditionPredicate is a function that indicates whether the given cluster's conditions meet
// some set of criteria defined by the function.
type ClusterConditionPredicate func(cluster v1beta1.Cluster) bool
// storeToClusterConditionLister filters and returns nodes matching the given type and status from the store.
type storeToClusterConditionLister struct {
store kubecache.Store
predicate ClusterConditionPredicate
}
// ClusterCondition returns a storeToClusterConditionLister
func (s *StoreToClusterLister) ClusterCondition(predicate ClusterConditionPredicate) storeToClusterConditionLister {
return storeToClusterConditionLister{s.Store, predicate}
}
// List returns a list of clusters that match the conditions defined by the predicate functions in the storeToClusterConditionLister.
func (s storeToClusterConditionLister) List() (clusters v1beta1.ClusterList, err error) {
for _, m := range s.store.List() {
cluster := *m.(*v1beta1.Cluster)
if s.predicate(cluster) {
clusters.Items = append(clusters.Items, cluster)
} else {
glog.V(5).Infof("Cluster %s matches none of the conditions", cluster.Name)
}
}
return
}
...@@ -33,10 +33,7 @@ import ( ...@@ -33,10 +33,7 @@ import (
) )
const ( const (
UserAgentName = "Cluster-Controller" UserAgentName = "Cluster-Controller"
KubeAPIQPS = 20.0
KubeAPIBurst = 30
KubeconfigSecretDataKey = "kubeconfig"
) )
type ClusterClient struct { type ClusterClient struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment