From ffafac3a69c005e6487cdd3b80469fbfee29c10f Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Tue, 17 Sep 2024 09:54:35 +0800 Subject: [PATCH 1/2] chore: pkg import only once (#1942) Signed-off-by: guoguangwu Co-authored-by: Peter Grant <117960526+franknstyle@users.noreply.github.com> --- pkg/client/logs_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/client/logs_test.go b/pkg/client/logs_test.go index ccc34bc9a..4ec8d3be7 100644 --- a/pkg/client/logs_test.go +++ b/pkg/client/logs_test.go @@ -21,7 +21,6 @@ import ( "testing" "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -255,14 +254,14 @@ func TestLogReaderInvalidConfig(t *testing.T) { func TestPodsForLogs(t *testing.T) { pluginName := "my-plugin" - pluginPod := corev1.Pod{ + pluginPod := v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "sonobuoy-plugin": pluginName, }, }, } - allPods := &corev1.PodList{Items: []corev1.Pod{pluginPod, {}}} + allPods := &v1.PodList{Items: []v1.Pod{pluginPod, {}}} testCases := []struct { desc string pluginName string From 18bb79d326511d4adad606009a29249e958a36a5 Mon Sep 17 00:00:00 2001 From: Fernando Cainelli Date: Mon, 16 Sep 2024 23:10:58 -0300 Subject: [PATCH 2/2] Fix potential deadlock retrieving results (#1941) Signed-off-by: Fernando Cainelli Co-authored-by: Peter Grant <117960526+franknstyle@users.noreply.github.com> --- pkg/client/retrieve.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/client/retrieve.go b/pkg/client/retrieve.go index 203c3e887..137681e15 100644 --- a/pkg/client/retrieve.go +++ b/pkg/client/retrieve.go @@ -60,6 +60,7 @@ func (c *SonobuoyClient) RetrieveResults(cfg *RetrieveConfig) (io.Reader, <-chan ec := make(chan error, 1) client, err := c.Client() if err != nil { + ec <- err return nil, ec, nil }