From b9a9fb118d295ced440262f4c27be6c9142a0bf3 Mon Sep 17 00:00:00 2001 From: Eugene Berger Date: Tue, 29 Nov 2022 17:54:51 +0200 Subject: [PATCH] bugfix for port forward custom containers not showing #1844 (#1877) * bugfix for port forward costum containers not showing #1844 * Adjust the port forward test key structure Co-authored-by: Eugene --- internal/dao/port_forward.go | 2 +- internal/dao/port_forward_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/dao/port_forward.go b/internal/dao/port_forward.go index 5afbaa67..c4f05837 100644 --- a/internal/dao/port_forward.go +++ b/internal/dao/port_forward.go @@ -75,7 +75,7 @@ var podNameRX = regexp.MustCompile(`\A(.+)\-(\w{10})\-(\w{5})\z`) // PodToKey converts a pod path to a generic bench config key. func PodToKey(path string) string { - tokens := strings.Split(path, ":") + tokens := strings.Split(path, "|") ns, po := client.Namespaced(tokens[0]) sections := podNameRX.FindStringSubmatch(po) if len(sections) >= 1 { diff --git a/internal/dao/port_forward_test.go b/internal/dao/port_forward_test.go index 691eee7f..d5d757a3 100644 --- a/internal/dao/port_forward_test.go +++ b/internal/dao/port_forward_test.go @@ -14,7 +14,7 @@ func TestBenchForConfig(t *testing.T) { spec config.BenchConfig }{ "no_file": {file: "", key: "", spec: config.DefaultBenchSpec()}, - "spec": {file: "testdata/benchspec.yml", key: "default/nginx-123-456:nginx", spec: config.BenchConfig{ + "spec": {file: "testdata/benchspec.yml", key: "default/nginx-123-456|nginx", spec: config.BenchConfig{ C: 2, N: 3000, HTTP: config.HTTP{