diff --git a/controller/api/destination/endpoint_profile_translator_test.go b/controller/api/destination/endpoint_profile_translator_test.go index a44e1ce962f1f..88e2f016ed04e 100644 --- a/controller/api/destination/endpoint_profile_translator_test.go +++ b/controller/api/destination/endpoint_profile_translator_test.go @@ -1,6 +1,8 @@ package destination import ( + "errors" + "net/http" "testing" "time" @@ -113,8 +115,9 @@ func TestEndpointProfileTranslator(t *testing.T) { // The queue should be full and the next update should fail. t.Logf("Queue length=%d capacity=%d", translator.queueLen(), updateQueueCapacity) if err := translator.Update(podAddr); err == nil { - t.Fatalf("Expected update to fail; queue=%d; capacity=%d", translator.queueLen(), updateQueueCapacity) - + if !errors.Is(err, http.ErrServerClosed) { + t.Fatalf("Expected update to fail; queue=%d; capacity=%d", translator.queueLen(), updateQueueCapacity) + } } select { diff --git a/controller/cmd/destination/main.go b/controller/cmd/destination/main.go index 84f2036fa66b4..cc8bcc9efa0e8 100644 --- a/controller/cmd/destination/main.go +++ b/controller/cmd/destination/main.go @@ -2,8 +2,10 @@ package destination import ( "context" + "errors" "flag" "net" + "net/http" "os" "os/signal" "syscall" @@ -56,7 +58,11 @@ func Main(args []string) { go func() { log.Infof("starting admin server on %s", *metricsAddr) if err := adminServer.ListenAndServe(); err != nil { - log.Errorf("failed to start destination admin server: %s", err) + if errors.Is(err, http.ErrServerClosed) { + log.Infof("Admin server closed (%s)", *metricsAddr) + } else { + log.Errorf("Admin server error (%s): %s", *metricsAddr, err) + } } }()