Skip to content

Commit 7ec1ac5

Browse files
committed
debug: fix reconcileSource_authStrategy
Signed-off-by: Sunny <darkowlzz@protonmail.com>
1 parent 892a983 commit 7ec1ac5

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
@@ -425,19 +425,20 @@ func TestGitRepositoryReconciler_reconcileSource_authStrategy(t *testing.T) {
425425
}
426426

427427
for _, tt := range tests {
428-
obj := &sourcev1.GitRepository{
429-
ObjectMeta: metav1.ObjectMeta{
430-
GenerateName: "auth-strategy-",
431-
},
432-
Spec: sourcev1.GitRepositorySpec{
433-
Interval: metav1.Duration{Duration: interval},
434-
Timeout: &metav1.Duration{Duration: interval},
435-
},
436-
}
437-
428+
tt := tt
438429
t.Run(tt.name, func(t *testing.T) {
439430
g := NewWithT(t)
440431

432+
obj := &sourcev1.GitRepository{
433+
ObjectMeta: metav1.ObjectMeta{
434+
GenerateName: "auth-strategy-",
435+
},
436+
Spec: sourcev1.GitRepositorySpec{
437+
Interval: metav1.Duration{Duration: interval},
438+
Timeout: &metav1.Duration{Duration: interval},
439+
},
440+
}
441+
441442
server, err := gittestserver.NewTempGitServer()
442443
g.Expect(err).NotTo(HaveOccurred())
443444
defer os.RemoveAll(server.Root())
@@ -499,6 +500,7 @@ func TestGitRepositoryReconciler_reconcileSource_authStrategy(t *testing.T) {
499500
}
500501

501502
for _, i := range testGitImplementations {
503+
i := i
502504
t.Run(i, func(t *testing.T) {
503505
g := NewWithT(t)
504506

0 commit comments

Comments
 (0)