Move util.StringSet into its own package

A lot of packages use StringSet, but they don't use anything else from
the util package. Moving StringSet into another package will shrink
their dependency trees significantly.
This commit is contained in:
tummychow
2015-09-09 10:45:01 -07:00
parent 1313e3b14e
commit 78ce5da988
98 changed files with 473 additions and 429 deletions

View File

@@ -29,7 +29,7 @@ import (
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/watch"
)
@@ -45,7 +45,7 @@ func nameIndexFunc(obj interface{}) ([]string, error) {
// ServiceAccountsControllerOptions contains options for running a ServiceAccountsController
type ServiceAccountsControllerOptions struct {
// Names is the set of service account names to ensure exist in every namespace
Names util.StringSet
Names sets.String
// ServiceAccountResync is the interval between full resyncs of ServiceAccounts.
// If non-zero, all service accounts will be re-listed this often.
@@ -59,7 +59,7 @@ type ServiceAccountsControllerOptions struct {
}
func DefaultServiceAccountsControllerOptions() ServiceAccountsControllerOptions {
return ServiceAccountsControllerOptions{Names: util.NewStringSet("default")}
return ServiceAccountsControllerOptions{Names: sets.NewString("default")}
}
// NewServiceAccountsController returns a new *ServiceAccountsController.
@@ -117,7 +117,7 @@ type ServiceAccountsController struct {
stopChan chan struct{}
client client.Interface
names util.StringSet
names sets.String
serviceAccounts cache.Indexer
namespaces cache.Indexer