new IP allocator and add postgres to integration tests. (#1756)

This commit is contained in:
Kristoffer Dalby 2024-02-18 19:31:29 +01:00 committed by GitHub
parent f581d4d9c0
commit 384ca03208
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
119 changed files with 3686 additions and 443 deletions

View file

@ -18,12 +18,15 @@ import (
"github.com/puzpuzpuz/xsync/v3"
"github.com/samber/lo"
"golang.org/x/sync/errgroup"
"tailscale.com/envknob"
)
const (
scenarioHashLength = 6
)
var usePostgresForTest = envknob.Bool("HEADSCALE_INTEGRATION_POSTGRES")
func enabledVersions(vs map[string]bool) []string {
var ret []string
for version, enabled := range vs {
@ -452,6 +455,10 @@ func (s *Scenario) CreateHeadscaleEnv(
tsOpts []tsic.Option,
opts ...hsic.Option,
) error {
if usePostgresForTest {
opts = append(opts, hsic.WithPostgres())
}
headscale, err := s.Headscale(opts...)
if err != nil {
return err