mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Cleanup storeToClusterConditionLister
ClusterConditionPredicate() has been deleted, storeToClusterConditionLister will be unused.
This commit is contained in:
parent
2c8a156579
commit
7d4c66c5b5
1
federation/client/cache/BUILD
vendored
1
federation/client/cache/BUILD
vendored
@ -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",
|
||||
],
|
||||
)
|
||||
|
29
federation/client/cache/cluster_cache.go
vendored
29
federation/client/cache/cluster_cache.go
vendored
@ -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
|
||||
}
|
||||
|
@ -33,10 +33,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
UserAgentName = "Cluster-Controller"
|
||||
KubeAPIQPS = 20.0
|
||||
KubeAPIBurst = 30
|
||||
KubeconfigSecretDataKey = "kubeconfig"
|
||||
UserAgentName = "Cluster-Controller"
|
||||
)
|
||||
|
||||
type ClusterClient struct {
|
||||
|
Loading…
Reference in New Issue
Block a user