Skip to content

Commit 5a5093f

Browse files
authored
Use shared infromer factory (#317)
1 parent 0ccb948 commit 5a5093f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

run.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/appscode/kutil/discovery"
1212
"github.com/appscode/pat"
1313
api "github.com/appscode/stash/apis/stash"
14-
cs "github.com/appscode/stash/client/typed/stash/v1alpha1"
14+
cs "github.com/appscode/stash/client"
1515
"github.com/appscode/stash/pkg/controller"
1616
"github.com/appscode/stash/pkg/docker"
1717
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -25,12 +25,13 @@ func NewCmdRun() *cobra.Command {
2525
var (
2626
masterURL string
2727
kubeconfigPath string
28-
address string = ":56790"
29-
opts = controller.Options{
28+
address = ":56790"
29+
opts = controller.Options{
3030
DockerRegistry: docker.ACRegistry,
3131
StashImageTag: stringz.Val(v.Version.Version, "canary"),
32-
ResyncPeriod: 5 * time.Minute,
32+
ResyncPeriod: 10 * time.Minute,
3333
MaxNumRequeues: 5,
34+
NumThreads: 2,
3435
}
3536
scratchDir = "/tmp"
3637
)
@@ -64,7 +65,7 @@ func NewCmdRun() *cobra.Command {
6465
// Now let's start the controller
6566
stop := make(chan struct{})
6667
defer close(stop)
67-
go ctrl.Run(1, stop)
68+
go ctrl.Run(stop)
6869

6970
m := pat.New()
7071
m.Get("/metrics", promhttp.Handler())
@@ -73,7 +74,7 @@ func NewCmdRun() *cobra.Command {
7374
log.Infof("URL pattern: %s", pattern)
7475
exporter := &PrometheusExporter{
7576
kubeClient: kubeClient,
76-
stashClient: stashClient,
77+
stashClient: stashClient.StashV1alpha1(),
7778
scratchDir: scratchDir,
7879
}
7980
m.Get(pattern, exporter)

0 commit comments

Comments
 (0)