diff --git a/pkg/supportbundle/collect.go b/pkg/supportbundle/collect.go index 4f2cc51cb..f572c0f45 100644 --- a/pkg/supportbundle/collect.go +++ b/pkg/supportbundle/collect.go @@ -27,6 +27,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apiserver/pkg/storage/names" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/remotecommand" @@ -418,7 +419,6 @@ func runRemoteHostCollectors(ctx context.Context, hostCollectors []*troubleshoot mu.Unlock() return nil }) - // time.Sleep(1 * time.Second) } err = eg.Wait() @@ -426,7 +426,6 @@ func runRemoteHostCollectors(ctx context.Context, hostCollectors []*troubleshoot return nil, err } span.End() - // time.Sleep(1 * time.Second) } klog.V(2).Infof("All remote host collectors completed") @@ -532,7 +531,7 @@ func createHostCollectorDS(ctx context.Context, clientset kubernetes.Interface, ds := &appsv1.DaemonSet{ ObjectMeta: metav1.ObjectMeta{ - Name: "remote-host-collector", + Name: names.SimpleNameGenerator.GenerateName("remote-host-collector" + "-"), Namespace: ns, Labels: labels, }, diff --git a/test/e2e/support-bundle/host_remote_collector_e2e_test.go b/test/e2e/support-bundle/host_remote_collector_e2e_test.go index f56fc1a3f..a4a2346a1 100644 --- a/test/e2e/support-bundle/host_remote_collector_e2e_test.go +++ b/test/e2e/support-bundle/host_remote_collector_e2e_test.go @@ -7,7 +7,6 @@ import ( "os" "os/exec" "testing" - "time" "sigs.k8s.io/e2e-framework/pkg/envconf" "sigs.k8s.io/e2e-framework/pkg/features" @@ -19,7 +18,6 @@ func TestHostRemoteCollector(t *testing.T) { var out bytes.Buffer var errOut bytes.Buffer supportbundleName := "host-os-remote-collector" - time.Sleep(5 * time.Second) cmd := exec.CommandContext(ctx, sbBinary(), "spec/remoteHostCollectors.yaml", "--interactive=false", fmt.Sprintf("-o=%s", supportbundleName)) cmd.Stdout = &out cmd.Stderr = &errOut