Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7d4c66c5
Commit
7d4c66c5
authored
Apr 27, 2017
by
FengyunPan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup storeToClusterConditionLister
ClusterConditionPredicate() has been deleted, storeToClusterConditionLister will be unused.
parent
2c8a1565
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
34 deletions
+1
-34
BUILD
federation/client/cache/BUILD
+0
-1
cluster_cache.go
federation/client/cache/cluster_cache.go
+0
-29
cluster_client.go
...ation/pkg/federation-controller/cluster/cluster_client.go
+1
-4
No files found.
federation/client/cache/BUILD
View file @
7d4c66c5
...
...
@@ -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",
],
)
...
...
federation/client/cache/cluster_cache.go
View file @
7d4c66c5
...
...
@@ -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
}
federation/pkg/federation-controller/cluster/cluster_client.go
View file @
7d4c66c5
...
...
@@ -33,10 +33,7 @@ import (
)
const
(
UserAgentName
=
"Cluster-Controller"
KubeAPIQPS
=
20.0
KubeAPIBurst
=
30
KubeconfigSecretDataKey
=
"kubeconfig"
UserAgentName
=
"Cluster-Controller"
)
type
ClusterClient
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment