diff --git a/README.md b/README.md index 5075594..f4365f0 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ This section records common use cases for this kubectl plugin. ### Collecting profiles of Go programs ``` -$ kubectl curl "http://{pod}/debug/pprof/profile?debug=1&seconds=10" > ./profile +$ kubectl curl -o profile "http://{pod}/debug/pprof/profile?debug=1&seconds=10" $ go tool pprof -http :6060 ./profile ``` diff --git a/curl.go b/curl.go index 2a7bfea..9ffa88d 100644 --- a/curl.go +++ b/curl.go @@ -96,7 +96,9 @@ func main() { } func run(ctx context.Context) error { - cArgs := make([]string, 0) + cArgs := []string{ + "--header", "User-Agent: kubectl-curl", + } flags.ParseAll(os.Args[1:], func(flag *pflag.Flag, value string) error { if flag.Name == "silent" { 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 { } }() - log.Printf("waiting for port fowarding to be established") + log.Printf("waiting for port forwarding to be established") select { case <-f.Ready: case <-ctx.Done():