Skip to content

Commit b768947

Browse files
committed
fixup! feat: Add preflight checks framework
Add unit tests
1 parent ac6dc01 commit b768947

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/webhook/preflight/preflight.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ func (h *WebhookHandler) Handle(ctx context.Context, req admission.Request) admi
9999

100100
// Run all checks and collect results.
101101
resultCh := make(chan CheckResult, len(checks))
102-
defer close(resultCh)
103-
104102
wg := &sync.WaitGroup{}
105103
for _, check := range checks {
106104
wg.Add(1)
@@ -111,6 +109,7 @@ func (h *WebhookHandler) Handle(ctx context.Context, req admission.Request) admi
111109
}(ctx, check)
112110
}
113111
wg.Wait()
112+
close(resultCh)
114113

115114
for result := range resultCh {
116115
if result.Error {

0 commit comments

Comments
 (0)