@@ -68,6 +68,10 @@ type AdapterBase struct {
68
68
// DiscoveryInterval specifies the interval at which to recheck discovery
69
69
// information for the discovery RESTMapper. It's set from a flag.
70
70
DiscoveryInterval time.Duration
71
+ // ClientQPS specifies the maximum QPS for the client-side throttle. It's set from a flag.
72
+ ClientQPS float32
73
+ // ClientBurst specifies the maximum QPS burst for client-side throttle. It's set from a flag.
74
+ ClientBurst int
71
75
72
76
// FlagSet is the flagset to add flags to.
73
77
// It defaults to the normal CommandLine flags
@@ -107,7 +111,9 @@ func (b *AdapterBase) InstallFlags() {
107
111
"kubeconfig file pointing at the 'core' kubernetes server with enough rights to list " +
108
112
"any described objects" )
109
113
b .FlagSet .DurationVar (& b .DiscoveryInterval , "discovery-interval" , b .DiscoveryInterval ,
110
- "interval at which to refresh API discovery information" )
114
+ "Interval at which to refresh API discovery information" )
115
+ b .FlagSet .Float32Var (& b .ClientQPS , "client-qps" , rest .DefaultQPS , "Maximum QPS for client-side throttle" )
116
+ b .FlagSet .IntVar (& b .ClientBurst , "client-burst" , rest .DefaultBurst , "Maximum QPS burst for client-side throttle" )
111
117
})
112
118
}
113
119
@@ -150,6 +156,13 @@ func (b *AdapterBase) ClientConfig() (*rest.Config, error) {
150
156
}
151
157
b .clientConfig = clientConfig
152
158
}
159
+
160
+ if b .ClientQPS > 0 {
161
+ b .clientConfig .QPS = b .ClientQPS
162
+ }
163
+ if b .ClientBurst > 0 {
164
+ b .clientConfig .Burst = b .ClientBurst
165
+ }
153
166
return b .clientConfig , nil
154
167
}
155
168
0 commit comments