Skip to content

Commit a067f0e

Browse files
committed
fix: rename WHOAMI_PORT to WHOAMI_PORT_NUMBER
k8s creates env var based on service name, then WHOAMI_PORT exists and contains a URL instead of a number.
1 parent 28f8337 commit a067f0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Tiny Go webserver that prints os information and HTTP request to output
2222

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

2828
## Examples

app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func init() {
4343
flag.StringVar(&cert, "cert", "", "give me a certificate")
4444
flag.StringVar(&key, "key", "", "give me a key")
4545
flag.StringVar(&ca, "cacert", "", "give me a CA chain, enforces mutual TLS")
46-
flag.StringVar(&port, "port", getEnv("WHOAMI_PORT", "80"), "give me a port number")
46+
flag.StringVar(&port, "port", getEnv("WHOAMI_PORT_NUMBER", "80"), "give me a port number")
4747
flag.StringVar(&name, "name", os.Getenv("WHOAMI_NAME"), "give me a name")
4848
}
4949

0 commit comments

Comments
 (0)