In pkg/knative/deployer.go, the Deploy function (new-service creation path, around line 237) starts a background goroutine that polls isImageInPrivateRegistry every 5 seconds and sends results on an unbuffered channel (chprivate).
If the WaitForService goroutine completes first (service becomes ready via cherr), the main function breaks out of the select loop and returns. The poller goroutine is then stuck on the unbuffered channel send at line 242 (chprivate <- private) with no receiver, and it blocks forever. The time.Sleep at line 240 also does not respect context cancellation.
This leaks the goroutine and everything it captures (the deployer, serving client, and function struct).
Fix: use a done channel or context to signal the poller goroutine to exit when the main select loop finishes.
In pkg/knative/deployer.go, the Deploy function (new-service creation path, around line 237) starts a background goroutine that polls isImageInPrivateRegistry every 5 seconds and sends results on an unbuffered channel (chprivate).
If the WaitForService goroutine completes first (service becomes ready via cherr), the main function breaks out of the select loop and returns. The poller goroutine is then stuck on the unbuffered channel send at line 242 (chprivate <- private) with no receiver, and it blocks forever. The time.Sleep at line 240 also does not respect context cancellation.
This leaks the goroutine and everything it captures (the deployer, serving client, and function struct).
Fix: use a done channel or context to signal the poller goroutine to exit when the main select loop finishes.