Skip to content

Commit

Permalink
fix: rename WHOAMI_PORT to WHOAMI_PORT_NUMBER
Browse files Browse the repository at this point in the history
k8s creates env var based on service name,
then WHOAMI_PORT exists and contains a URL instead of a number.
  • Loading branch information
ldez committed Dec 3, 2021
1 parent 28f8337 commit a067f0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Tiny Go webserver that prints os information and HTTP request to output

- `cert`: give me a certificate.
- `key`: give me a key.
- `port`: give me a port number. (it can be also defined with `WHOAMI_PORT` environment variable) (default: 80)
- `port`: give me a port number. (it can be also defined with `WHOAMI_PORT_NUMBER` environment variable) (default: 80)
- `name`: give me a name. (it can be also defined with `WHOAMI_NAME` environment variable)

## Examples
Expand Down
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func init() {
flag.StringVar(&cert, "cert", "", "give me a certificate")
flag.StringVar(&key, "key", "", "give me a key")
flag.StringVar(&ca, "cacert", "", "give me a CA chain, enforces mutual TLS")
flag.StringVar(&port, "port", getEnv("WHOAMI_PORT", "80"), "give me a port number")
flag.StringVar(&port, "port", getEnv("WHOAMI_PORT_NUMBER", "80"), "give me a port number")
flag.StringVar(&name, "name", os.Getenv("WHOAMI_NAME"), "give me a name")
}

Expand Down

0 comments on commit a067f0e

Please sign in to comment.