Skip to content

Commit 4d2da25

Browse files
committed
Remove dependency on k8s.io/client-go/rest for two constants
1 parent fb4a17a commit 4d2da25

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cmd/controller/main.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"github.com/tektoncd/pipeline/pkg/reconciler/resolutionrequest"
2929
"github.com/tektoncd/pipeline/pkg/reconciler/taskrun"
3030
corev1 "k8s.io/api/core/v1"
31-
"k8s.io/client-go/rest"
3231
"k8s.io/utils/clock"
3332
filteredinformerfactory "knative.dev/pkg/client/injection/kube/informers/factory/filtered"
3433
"knative.dev/pkg/controller"
@@ -43,6 +42,13 @@ const (
4342
)
4443

4544
func main() {
45+
// To avoid dependency on "k8s.io/client-go/rest" we are defining the
46+
// constants being used from the package over here
47+
// the names of the constants are the same in the package as well.
48+
const (
49+
DefaultQPS float32 = 5.0
50+
DefaultBurst int = 10
51+
)
4652
flag.IntVar(&controller.DefaultThreadsPerController, "threads-per-controller", controller.DefaultThreadsPerController, "Threads (goroutines) to create per controller")
4753
namespace := flag.String("namespace", corev1.NamespaceAll, "Namespace to restrict informer to. Optional, defaults to all namespaces.")
4854
disableHighAvailability := flag.Bool("disable-ha", false, "Whether to disable high-availability functionality for this component. This flag will be deprecated "+
@@ -64,11 +70,12 @@ func main() {
6470
if err := opts.Images.Validate(); err != nil {
6571
log.Fatal(err)
6672
}
73+
6774
if cfg.QPS == 0 {
68-
cfg.QPS = 2 * rest.DefaultQPS
75+
cfg.QPS = 2 * DefaultQPS
6976
}
7077
if cfg.Burst == 0 {
71-
cfg.Burst = rest.DefaultBurst
78+
cfg.Burst = DefaultBurst
7279
}
7380
// FIXME(vdemeester): this is here to not break current behavior
7481
// multiply by 2, no of controllers being created

0 commit comments

Comments
 (0)