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.
4545### Collecting profiles of Go programs
4646
4747```
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"
4949$ go tool pprof -http :6060 ./profile
5050```
5151
Original file line number Diff line number Diff line change @@ -96,7 +96,9 @@ func main() {
9696}
9797
9898func run (ctx context.Context ) error {
99- cArgs := make ([]string , 0 )
99+ cArgs := []string {
100+ "--header" , "User-Agent: kubectl-curl" ,
101+ }
100102 flags .ParseAll (os .Args [1 :], func (flag * pflag.Flag , value string ) error {
101103 if flag .Name == "silent" {
102104 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 {
239241 }
240242 }()
241243
242- log .Printf ("waiting for port fowarding to be established" )
244+ log .Printf ("waiting for port forwarding to be established" )
243245 select {
244246 case <- f .Ready :
245247 case <- ctx .Done ():
You can’t perform that action at this time.
0 commit comments