forked from letsencrypt/boulder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ratelimits: Add a feature-flag which makes key-value implementation a…
…uthoritative (letsencrypt#7666) - Add feature flag `UseKvLimitsForNewOrder` - Add feature flag `UseKvLimitsForNewAccount` - Flush all Redis shards before running integration or unit tests, this avoids false positives between local testing runs Fixes letsencrypt#7664 Blocked by letsencrypt#7676
- Loading branch information
1 parent
c7a04e8
commit c9be034
Showing
12 changed files
with
203 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/letsencrypt/boulder/cmd" | ||
blog "github.com/letsencrypt/boulder/log" | ||
"github.com/letsencrypt/boulder/metrics" | ||
bredis "github.com/letsencrypt/boulder/redis" | ||
|
||
"github.com/redis/go-redis/v9" | ||
) | ||
|
||
func main() { | ||
rc := bredis.Config{ | ||
Username: "unittest-rw", | ||
TLS: cmd.TLSConfig{ | ||
CACertFile: "test/certs/ipki/minica.pem", | ||
CertFile: "test/certs/ipki/localhost/cert.pem", | ||
KeyFile: "test/certs/ipki/localhost/key.pem", | ||
}, | ||
Lookups: []cmd.ServiceDomain{ | ||
{ | ||
Service: "redisratelimits", | ||
Domain: "service.consul", | ||
}, | ||
}, | ||
LookupDNSAuthority: "consul.service.consul", | ||
} | ||
rc.PasswordConfig = cmd.PasswordConfig{ | ||
PasswordFile: "test/secrets/ratelimits_redis_password", | ||
} | ||
|
||
stats := metrics.NoopRegisterer | ||
log := blog.NewMock() | ||
ring, err := bredis.NewRingFromConfig(rc, stats, log) | ||
if err != nil { | ||
fmt.Printf("while constructing ring client: %v\n", err) | ||
os.Exit(1) | ||
} | ||
|
||
err = ring.ForEachShard(context.Background(), func(ctx context.Context, shard *redis.Client) error { | ||
cmd := shard.FlushAll(ctx) | ||
_, err := cmd.Result() | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
}) | ||
if err != nil { | ||
fmt.Printf("while flushing redis shards: %v\n", err) | ||
os.Exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.