Skip to content

Commit 5c3142e

Browse files
darkowlzzMax Jonas Werner
authored andcommitted
debug: fix reconcileSource_authStrategy
Signed-off-by: Sunny <[email protected]>
1 parent 9f3025d commit 5c3142e

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

controllers/gitrepository_controller_test.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,19 +428,20 @@ func TestGitRepositoryReconciler_reconcileSource_authStrategy(t *testing.T) {
428428
}
429429

430430
for _, tt := range tests {
431-
obj := &sourcev1.GitRepository{
432-
ObjectMeta: metav1.ObjectMeta{
433-
GenerateName: "auth-strategy-",
434-
},
435-
Spec: sourcev1.GitRepositorySpec{
436-
Interval: metav1.Duration{Duration: interval},
437-
Timeout: &metav1.Duration{Duration: timeout},
438-
},
439-
}
440-
431+
tt := tt
441432
t.Run(tt.name, func(t *testing.T) {
442433
g := NewWithT(t)
443434

435+
obj := &sourcev1.GitRepository{
436+
ObjectMeta: metav1.ObjectMeta{
437+
GenerateName: "auth-strategy-",
438+
},
439+
Spec: sourcev1.GitRepositorySpec{
440+
Interval: metav1.Duration{Duration: interval},
441+
Timeout: &metav1.Duration{Duration: interval},
442+
},
443+
}
444+
444445
server, err := gittestserver.NewTempGitServer()
445446
g.Expect(err).NotTo(HaveOccurred())
446447
defer os.RemoveAll(server.Root())
@@ -502,6 +503,7 @@ func TestGitRepositoryReconciler_reconcileSource_authStrategy(t *testing.T) {
502503
}
503504

504505
for _, i := range testGitImplementations {
506+
i := i
505507
t.Run(i, func(t *testing.T) {
506508
g := NewWithT(t)
507509

0 commit comments

Comments
 (0)