@@ -96,7 +96,9 @@ func main() {
96
96
}
97
97
98
98
func run (ctx context.Context ) error {
99
- cArgs := make ([]string , 0 )
99
+ cArgs := []string {
100
+ "--header" , "User-Agent: kubectl-curl" ,
101
+ }
100
102
flags .ParseAll (os .Args [1 :], func (flag * pflag.Flag , value string ) error {
101
103
if flag .Name == "silent" {
102
104
return nil // --silent is added later to all curl arguments so don't add here
@@ -239,7 +241,7 @@ func run(ctx context.Context) error {
239
241
}
240
242
}()
241
243
242
- log .Printf ("waiting for port fowarding to be established" )
244
+ log .Printf ("waiting for port forwarding to be established" )
243
245
select {
244
246
case <- f .Ready :
245
247
case <- ctx .Done ():
@@ -253,6 +255,11 @@ func run(ctx context.Context) error {
253
255
// print the dynamic progress view for the scenarios in which this
254
256
// plugin is useful for.
255
257
cArgs = append (cArgs , "--silent" )
258
+ // Override any settings that users might have by default - for example,
259
+ // Kevin Burke has "-w \n" in his .curlrc file. Adding a new line to the end
260
+ // of the file is great for readability for most responses but breaks pprof
261
+ // and trace parsing.
262
+ cArgs = append (cArgs , "-w" , "" )
256
263
257
264
cmd := exec .CommandContext (ctx , "curl" , cArgs ... )
258
265
cmd .Stdin = os .Stdin
0 commit comments