diff --git a/builtin/credential/ldap/backend_test.go b/builtin/credential/ldap/backend_test.go index beda248e4b09..7c59ece7b607 100644 --- a/builtin/credential/ldap/backend_test.go +++ b/builtin/credential/ldap/backend_test.go @@ -1219,6 +1219,9 @@ func TestLdapAuthBackend_ConfigUpgrade(t *testing.T) { falseBool := new(bool) *falseBool = false + maxPageInt := new(int) + *maxPageInt = 1000 + exp := &ldapConfigEntry{ TokenParams: tokenutil.TokenParams{ TokenPeriod: 5 * time.Minute, @@ -1243,7 +1246,7 @@ func TestLdapAuthBackend_ConfigUpgrade(t *testing.T) { ConnectionTimeout: cfg.ConnectionTimeout, UsernameAsAlias: false, DerefAliases: "never", - MaximumPageSize: 1000, + MaximumPageSize: maxPageInt, }, } diff --git a/helper/testhelpers/ldap/ldaphelper.go b/helper/testhelpers/ldap/ldaphelper.go index 4f89f429cf28..9d5a8d4940d4 100644 --- a/helper/testhelpers/ldap/ldaphelper.go +++ b/helper/testhelpers/ldap/ldaphelper.go @@ -36,7 +36,9 @@ func PrepareTestContainer(t *testing.T, version string) (cleanup func(), cfg *ld cfg.GroupDN = "ou=people,dc=planetexpress,dc=com" cfg.GroupAttr = "cn" cfg.RequestTimeout = 60 - *cfg.MaximumPageSize = 1000 + + maxPageSize := 1000 + cfg.MaximumPageSize = &maxPageSize svc, err := runner.StartService(context.Background(), func(ctx context.Context, host string, port int) (docker.ServiceConfig, error) { connURL := fmt.Sprintf("ldap://%s:%d", host, port)