Skip to content

Commit

Permalink
update docs and copyright notice
Browse files Browse the repository at this point in the history
  • Loading branch information
Achille Roussel committed Sep 20, 2021
1 parent 0d9c125 commit 177fcec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Segment
Copyright 2021 Twilio Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ Kubectl plugin to run curl commands against kubernetes pods

## Motivation

Sending http requests to kubernetes pods is unnecessarily complicated, this plugin makes it easy.
Sending http requests to kubernetes pods is unnecessarily complicated, this
plugin makes it easy.

The plugin creates a port forwarding from the local network to the kubernetes
pod that was selected to receive the request, then instantiate a curl command
by rewriting the URL to connect to the forwarded local port, and passing all
curl options that were given on the command line.

## Installation

Expand All @@ -29,7 +35,8 @@ kubectl curl [options] URL [container]

* In the URL, the host part must be the name of the pod to send the request to.
* If no port number is specified, the request will be sent to a `http` port.
* If there are multiple containers with a `http` port, the name of the container to send to the request to must be specified after the URL.
* If there are multiple containers with a `http` port, the name of the container
to send to the request to must be specified after the URL.

## Examples

Expand Down
4 changes: 2 additions & 2 deletions curl.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func init() {
log.SetPrefix("* ")

flags = pflag.NewFlagSet("kubectl curl", pflag.ExitOnError)
flags.BoolVarP(&help, "help", "h", false, "Prints the kubectl pprof help.")
flags.BoolVarP(&help, "help", "h", false, "Prints the kubectl plugin help.")
flags.BoolVarP(&debug, "debug", "", false, "Enable debug mode to print more details about the kubectl command execution.")

for _, opt := range curlOptions {
Expand Down Expand Up @@ -81,7 +81,7 @@ func main() {
defer stop()

if err := run(ctx); err != nil {
fmt.Fprintf(os.Stderr, "* ERROR: %s", err)
fmt.Fprintf(os.Stderr, "* ERROR: %s\n", err)
os.Exit(1)
}
}
Expand Down

0 comments on commit 177fcec

Please sign in to comment.