Skip to content

Commit

Permalink
Merge pull request #45 from uswitch/airship-2513-make-port-configurable
Browse files Browse the repository at this point in the history
AIRSHIP-2513 Make port configurable and default to 8443
  • Loading branch information
DewaldV authored Mar 22, 2023
2 parents 4eaf805 + 7c028e6 commit 6315f6c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,21 @@ spec:
configMap:
name: my-template
```

## Args

```ShellSession
usage: vault-webhook-linux-amd64 --vault-address=VAULT-ADDRESS --login-path=LOGIN-PATH --sidecar-image=SIDECAR-IMAGE [<flags>]
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--vault-address=VAULT-ADDRESS URL of vault
--vault-ca-path=VAULT-CA-PATH Path to the CA cert for vault
--login-path=LOGIN-PATH Kubernetes auth login path for vault
--sidecar-image=SIDECAR-IMAGE Vault-creds sidecar image to use
--gateway-address=GATEWAY-ADDRESS
URL of Push Gateway
--secret-path-format="%s/creds/%s"
The format for the path used for reading database credentials, where the first %s is the database name and the second %s is the role
--server-address=":8443" The address the webhook server will listen on.
```
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var (
loginPath string
secretPathFormat string
sidecarImage string
serverAddress string
)

func main() {
Expand All @@ -34,6 +35,7 @@ func main() {
kingpin.Flag("sidecar-image", "Vault-creds sidecar image to use").Required().StringVar(&sidecarImage)
kingpin.Flag("gateway-address", "URL of Push Gateway").StringVar(&gatewayAddr)
kingpin.Flag("secret-path-format", "The format for the path used for reading database credentials, where the first %s is the database name and the second %s is the role").Default("%s/creds/%s").StringVar(&secretPathFormat)
kingpin.Flag("server-address", "The address the webhook server will listen on.").Default(":8443").StringVar(&serverAddress)
kingpin.Parse()
log.SetOutput(os.Stderr)

Expand Down Expand Up @@ -62,7 +64,7 @@ func main() {

watcher := NewListWatch(webhookClient)

srv := http.Server{Addr: fmt.Sprintf(":443")}
srv := http.Server{Addr: serverAddress}

// this will check if there are new certs before every tls handshake
t := &tls.Config{GetCertificate: kpr.GetCertificateFunc()}
Expand Down

0 comments on commit 6315f6c

Please sign in to comment.