Skip to content

Commit a0b4b5e

Browse files
fix: pass TLS options to redis client in delete-redis-retry-keys
1 parent 3f888c6 commit a0b4b5e

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

hack/delete-redis-retry-keys/README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,29 @@ The tool deletes keys matching the pattern `{environment-id}:goal_event_retry:*`
1010
go run ./hack/delete-redis-retry-keys delete \
1111
--redis-addr=<REDIS_HOST:PORT> \
1212
--environment-id=<ENVIRONMENT_ID> \
13-
--redis-password=<REDIS_PASSWORD> \ # optional
14-
--scan-count=<SCAN_COUNT> \ # optional, defaults to 100
15-
--redis-tls-enabled \ # optional, defaults to false
16-
--redis-tls-ca-cert=<PATH> \ # optional, defaults to the system CA pool
17-
--redis-tls-cert=<PATH> \ # optional, for mutual TLS
18-
--redis-tls-key=<PATH> \ # optional, for mutual TLS
19-
--redis-tls-insecure-skip-verify \ # optional, not recommended for production
13+
--redis-password=<REDIS_PASSWORD> \
14+
--scan-count=<SCAN_COUNT> \
15+
--redis-tls-enabled \
16+
--redis-tls-ca-cert=<PATH> \
17+
--redis-tls-cert=<PATH> \
18+
--redis-tls-key=<PATH> \
19+
--redis-tls-insecure-skip-verify \
2020
--no-profile \
2121
--no-gcp-trace-enabled
2222
```
2323

24+
Optional flags:
25+
26+
| Flag | Description |
27+
| --- | --- |
28+
| `--redis-password` | Redis password. |
29+
| `--scan-count` | Number of keys to scan per iteration. Defaults to 100. |
30+
| `--redis-tls-enabled` | Connect over TLS. Defaults to false. |
31+
| `--redis-tls-ca-cert` | CA certificate path. Uses the system CA pool if unset. |
32+
| `--redis-tls-cert` | Client certificate path, for mutual TLS. |
33+
| `--redis-tls-key` | Client private key path, for mutual TLS. |
34+
| `--redis-tls-insecure-skip-verify` | Skip server certificate verification. Not recommended for production. |
35+
2436
### Example: Delete retry keys for e2e environment (minikube)
2537

2638
```bash

hack/delete-redis-retry-keys/command.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ func (c *command) Run(ctx context.Context, metrics metrics.Metrics, logger *zap.
8989

9090
opts := []redisv3.Option{
9191
redisv3.WithLogger(logger),
92+
redisv3.WithTLS(redisv3.TLSConfig{
93+
Enabled: *c.redisTLSEnabled,
94+
CACert: *c.redisTLSCACert,
95+
Cert: *c.redisTLSCert,
96+
Key: *c.redisTLSKey,
97+
InsecureSkipVerify: *c.redisTLSInsecureSkipVerify,
98+
}),
9299
}
93100
if *c.redisPassword != "" {
94101
opts = append(opts, redisv3.WithPassword(*c.redisPassword))

0 commit comments

Comments
 (0)