Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for namespace deletion #142

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions cmd/k8s-netperf/k8s-netperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"k8s.io/client-go/tools/clientcmd"
)

const namespace = "netperf"
const index = "k8s-netperf"
const retry = 3

Expand Down Expand Up @@ -304,32 +303,7 @@ var rootCmd = &cobra.Command{
}

func cleanup(client *kubernetes.Clientset) {
log.Info("Cleaning resources created by k8s-netperf")
svcList, err := k8s.GetServices(client, namespace)
if err != nil {
log.Fatal(err)
}
for svc := range svcList.Items {
err = k8s.DestroyService(client, svcList.Items[svc])
if err != nil {
log.Error(err)
}
}
dpList, err := k8s.GetDeployments(client, namespace)
if err != nil {
log.Fatal(err)
}
for dp := range dpList.Items {
err = k8s.DestroyDeployment(client, dpList.Items[dp])
if err != nil {
log.Error(err)
}
_, err := k8s.WaitForDelete(client, dpList.Items[dp])
if err != nil {
log.Fatal(err)
}
}
err = k8s.DestroyNamespace(client)
err := k8s.DestroyNamespace(client)
if err != nil {
log.Error(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/iperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (i *iperf3) Run(c *kubernetes.Clientset, rc rest.Config, nc config.Config,
id := uuid.New()
file := fmt.Sprintf("/tmp/iperf-%s", id.String())
pod := client.Items[0]
log.Debugf("🔥 Client (%s,%s) starting iperf3 against server : %s", pod.Name, pod.Status.PodIP, serverIP)
log.Debugf("🔥 Client (%s,%s) starting iperf3 against server: %s", pod.Name, pod.Status.PodIP, serverIP)
config.Show(nc, i.driverName)
tcp := true
if !strings.Contains(nc.Profile, "STREAM") {
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/netperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const omniOptions = "rt_latency,p99_latency,throughput,throughput_units,remote_r
func (n *netperf) Run(c *kubernetes.Clientset, rc rest.Config, nc config.Config, client apiv1.PodList, serverIP string) (bytes.Buffer, error) {
var stdout, stderr bytes.Buffer
pod := client.Items[0]
log.Debugf("🔥 Client (%s,%s) starting netperf against server : %s", pod.Name, pod.Status.PodIP, serverIP)
log.Debugf("🔥 Client (%s,%s) starting netperf against server: %s", pod.Name, pod.Status.PodIP, serverIP)
config.Show(nc, n.driverName)
cmd := []string{superNetperf, strconv.Itoa(nc.Parallelism), strconv.Itoa(k8s.NetperfServerDataPort), "-H",
serverIP, "-l",
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/uperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (u *uperf) Run(c *kubernetes.Clientset, rc rest.Config, nc config.Config, c
var exec remotecommand.Executor

pod := client.Items[0]
log.Debugf("🔥 Client (%s,%s) starting uperf against server : %s", pod.Name, pod.Status.PodIP, serverIP)
log.Debugf("🔥 Client (%s,%s) starting uperf against server: %s", pod.Name, pod.Status.PodIP, serverIP)
config.Show(nc, u.driverName)

filePath, err := createUperfProfile(c, rc, nc, pod, serverIP)
Expand Down
Loading
Loading