mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-06 16:17:08 +00:00
Enable 'intrange' linter
This commit is contained in:
@@ -150,7 +150,7 @@ func TestAPIServingCertificateAutoCreationAndRotation_Disruptive(t *testing.T) {
|
||||
// our code changes all the certs immediately thus this should be healthy fairly quickly
|
||||
// if this starts flaking, check for bugs in our dynamiccertificates.Notifier implementation
|
||||
testlib.RequireEventually(t, func(requireEventually *require.Assertions) {
|
||||
for i := 0; i < 10; i++ {
|
||||
for range 10 {
|
||||
_, err := conciergeClient.LoginV1alpha1().TokenCredentialRequests().Create(ctx, &loginv1alpha1.TokenCredentialRequest{
|
||||
TypeMeta: metav1.TypeMeta{},
|
||||
ObjectMeta: metav1.ObjectMeta{},
|
||||
|
||||
@@ -781,7 +781,7 @@ func TestSimultaneousLDAPRequestsOnSingleProvider(t *testing.T) {
|
||||
// without triggering the race detector.
|
||||
iterations := 150
|
||||
resultCh := make(chan authUserResult, iterations)
|
||||
for i := 0; i < iterations; i++ {
|
||||
for range iterations {
|
||||
go func() {
|
||||
authUserCtx, authUserCtxCancelFunc := context.WithTimeout(context.Background(), 2*time.Minute)
|
||||
defer authUserCtxCancelFunc()
|
||||
@@ -794,7 +794,7 @@ func TestSimultaneousLDAPRequestsOnSingleProvider(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
}
|
||||
for i := 0; i < iterations; i++ {
|
||||
for range iterations {
|
||||
result := <-resultCh
|
||||
// Record failures but allow the test to keep running so that all the background goroutines have a chance to try.
|
||||
assert.NoError(t, result.err)
|
||||
@@ -854,7 +854,7 @@ func findRecentlyUnusedLocalhostPorts(t *testing.T, howManyPorts int) []string {
|
||||
t.Helper()
|
||||
|
||||
listeners := []net.Listener{}
|
||||
for i := 0; i < howManyPorts; i++ {
|
||||
for range howManyPorts {
|
||||
unusedPortGrabbingListener, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
require.NoError(t, err)
|
||||
listeners = append(listeners, unusedPortGrabbingListener)
|
||||
|
||||
@@ -170,7 +170,7 @@ func leaderElectionClients(t *testing.T, namespace *corev1.Namespace, leaseName
|
||||
clients := make(map[string]*kubeclient.Client, count)
|
||||
cancels := make(map[string]context.CancelFunc, count)
|
||||
|
||||
for i := 0; i < count; i++ {
|
||||
for range count {
|
||||
identity := "leader-election-client-" + rand.String(5)
|
||||
clients[identity], cancels[identity] = leaderElectionClient(t, namespace, leaseName, identity)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2023 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2023-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package integration
|
||||
@@ -929,7 +929,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
|
||||
// For the above tests, it should be enough to assume that there will only be indices up to 10.
|
||||
// This is useful when the only difference in the message between old and new is the missing indices.
|
||||
// Otherwise, use wantOldKubeErr to say what the expected message should be for old versions.
|
||||
for i := 0; i < 10; i++ {
|
||||
for i := range 10 {
|
||||
wantErr = strings.ReplaceAll(wantErr, fmt.Sprintf("[%d]", i), "")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ func makeErrFix(reallyOld bool) []string {
|
||||
out := make([]string, 0, total*6) // good enough allocation
|
||||
|
||||
// these servers do not show the actual index of where the error occurred
|
||||
for i := 0; i < total; i++ {
|
||||
for i := range total {
|
||||
idx := fmt.Sprintf("[%d]", i)
|
||||
out = append(out, idx+":", ":")
|
||||
out = append(out, idx+" ", " ")
|
||||
|
||||
@@ -139,9 +139,9 @@ func LockADTestUser(t *testing.T, env *TestEnv, testUserName string) {
|
||||
// our password policy allows 20 wrong attempts before locking the account, so do 21.
|
||||
// these wrong password attempts could go to different domain controllers, but account
|
||||
// lockout changes are urgently replicated, meaning that the domain controllers will be
|
||||
// synced asap rather than in the usual 15 second interval.
|
||||
// synced asap rather than in the usual 15-second interval.
|
||||
// See https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc961787(v=technet.10)#urgent-replication-of-account-lockout-changes
|
||||
for i := 0; i <= 21; i++ {
|
||||
for i := range 22 {
|
||||
err := conn.Bind(userDN, "not-the-right-password-"+fmt.Sprint(i))
|
||||
require.Error(t, err) // this should be an error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user