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