Cleanup storeToClusterConditionLister

ClusterConditionPredicate() has been deleted,
storeToClusterConditionLister will be unused.
This commit is contained in:
FengyunPan 2017-04-27 11:51:26 +08:00
parent 2c8a156579
commit 7d4c66c5b5
3 changed files with 1 additions and 34 deletions

View File

@ -13,7 +13,6 @@ go_library(
tags = ["automanaged"],
deps = [
"//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",
],
)

View File

@ -17,7 +17,6 @@ limitations under the License.
package cache
import (
"github.com/golang/glog"
kubecache "k8s.io/client-go/tools/cache"
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
)
@ -34,31 +33,3 @@ func (s *StoreToClusterLister) List() (clusters v1beta1.ClusterList, err error)
}
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
}

View File

@ -33,10 +33,7 @@ import (
)
const (
UserAgentName = "Cluster-Controller"
KubeAPIQPS = 20.0
KubeAPIBurst = 30
KubeconfigSecretDataKey = "kubeconfig"
UserAgentName = "Cluster-Controller"
)
type ClusterClient struct {