fixup! fixup! fixup! Move towards the self-provided Redis connection pool and RESP protocol implementation. Official redis client library won't work with yaegi.

This commit is contained in:
2025-10-19 13:30:08 +01:00
parent 0fbd6a3ffc
commit fdde481925
4 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -602,7 +602,7 @@ This approach allows you to manage all settings through Traefik's configuration
|-----------|-------------|---------|---------|
| `enabled` | Enable Redis caching | `false` | `true` |
| `address` | Redis server address | - | `redis:6379` |
| `password` | Redis password | - | `secret` |
| `password` | Redis password | - | `YOUR_PASSWORD` |
| `db` | Database number | `0` | `1` |
| `keyPrefix` | Key prefix for namespacing | `traefikoidc:` | `myapp:` |
| `cacheMode` | Cache mode: `redis`, `hybrid`, `memory` | `redis` | `hybrid` |
+5 -5
View File
@@ -113,7 +113,7 @@ http:
redis:
enabled: true
address: "redis-master.redis-namespace.svc.cluster.local:6379"
password: "strong-redis-password"
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
db: 0
keyPrefix: "traefikoidc:prod:"
@@ -146,7 +146,7 @@ http:
redis:
enabled: true
address: "redis.example.com:6380"
password: "secure-redis-password"
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
enableTLS: true
tlsSkipVerify: false # Verify certificates in production
cacheMode: "redis"
@@ -165,7 +165,7 @@ http:
redis:
enabled: true
address: "redis:6379"
password: "redis-password"
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
cacheMode: "hybrid"
# Hybrid mode L1 cache settings
@@ -375,7 +375,7 @@ metadata:
namespace: traefik
type: Opaque
stringData:
password: "your-secure-redis-password"
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
---
# OIDC Middleware with Redis
apiVersion: traefik.io/v1alpha1
@@ -397,7 +397,7 @@ spec:
redis:
enabled: true
address: "redis.traefik.svc.cluster.local:6379"
password: "your-secure-redis-password"
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
db: 0
keyPrefix: "traefikoidc:k8s:"
cacheMode: "hybrid"
+2 -2
View File
@@ -45,7 +45,7 @@ http:
redis:
enabled: true
address: "redis:6379"
password: "strong-password"
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD" # Example placeholder - use your actual password
db: 1
keyPrefix: "myapp:"
poolSize: 20
@@ -76,7 +76,7 @@ http:
redis:
enabled: true
address: "redis.example.com:6380"
password: "secure-password"
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD" # Example placeholder
enableTLS: true
tlsSkipVerify: false # Set to true only for testing
cacheMode: "redis"
+6 -1
View File
@@ -247,7 +247,12 @@ func (c *RedisConn) Do(command string, args ...string) (interface{}, error) {
defer c.mu.Unlock()
// Build command arguments
cmdArgs := make([]string, 0, len(args)+1)
// Check for overflow: ensure len(args)+1 doesn't overflow int
argsLen := len(args)
if argsLen < 0 || argsLen > (1<<31)-2 {
return nil, errors.New("too many arguments")
}
cmdArgs := make([]string, 0, argsLen+1)
cmdArgs = append(cmdArgs, command)
cmdArgs = append(cmdArgs, args...)