File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ This section records common use cases for this kubectl plugin.
45
45
### Collecting profiles of Go programs
46
46
47
47
```
48
- $ kubectl curl "http://{pod}/debug/pprof/profile?debug=1&seconds=10" > ./profile
48
+ $ kubectl curl -o profile "http://{pod}/debug/pprof/profile?debug=1&seconds=10"
49
49
$ go tool pprof -http :6060 ./profile
50
50
```
51
51
Original file line number Diff line number Diff line change @@ -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 ():
You can’t perform that action at this time.
0 commit comments