Skip to content

Commit

Permalink
use unique name for ds
Browse files Browse the repository at this point in the history
  • Loading branch information
DexterYan committed Nov 5, 2024
1 parent ebfa828 commit 01c643a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/supportbundle/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -418,15 +419,13 @@ func runRemoteHostCollectors(ctx context.Context, hostCollectors []*troubleshoot
mu.Unlock()
return nil
})
// time.Sleep(1 * time.Second)
}

err = eg.Wait()
if err != nil {
return nil, err
}
span.End()
// time.Sleep(1 * time.Second)
}

klog.V(2).Infof("All remote host collectors completed")
Expand Down Expand Up @@ -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,
},
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/support-bundle/host_remote_collector_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"os"
"os/exec"
"testing"
"time"

"sigs.k8s.io/e2e-framework/pkg/envconf"
"sigs.k8s.io/e2e-framework/pkg/features"
Expand All @@ -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
Expand Down

0 comments on commit 01c643a

Please sign in to comment.