From 0f16486047d4d06ef4021446d24b2063595654b7 Mon Sep 17 00:00:00 2001 From: Chris Kannon Date: Mon, 31 Jan 2022 16:02:39 -0500 Subject: [PATCH] Fix service https output and tests --- cmd/minikube/cmd/service.go | 8 +------- test/integration/functional_test.go | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cmd/minikube/cmd/service.go b/cmd/minikube/cmd/service.go index c6407a427414..754930932476 100644 --- a/cmd/minikube/cmd/service.go +++ b/cmd/minikube/cmd/service.go @@ -185,6 +185,7 @@ func startKicServiceTunnels(args []string, services service.URLs, configName str if err != nil { exit.Error(reason.SvcTunnelStart, "error starting tunnel", err) } + defer serviceTunnel.Stop() data = append(data, []string{namespace, svc.Name, "", strings.Join(urls, "\n")}) } @@ -199,13 +200,6 @@ func startKicServiceTunnels(args []string, services service.URLs, configName str out.WarningT("Because you are using a Docker driver on {{.operating_system}}, the terminal needs to be open to run it.", out.V{"operating_system": runtime.GOOS}) <-ctrlC - - for _, tunnel := range tunnels { - err = tunnel.Stop() - if err != nil { - exit.Error(reason.SvcTunnelStop, "error stopping tunnel", err) - } - } } func openURLs(svc string, urls []string) { diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index 5072972f57fc..b7b67887f74f 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -1465,7 +1465,7 @@ func validateServiceCmd(ctx context.Context, t *testing.T, profile string) { t.Errorf("expected stderr to be empty but got *%q* . args %q", rr.Stderr, rr.Command()) } - endpoint := strings.TrimSpace(rr.Stdout.String()) + endpoint := strings.TrimSpace(strings.Split(rr.Stdout.String(), "|")[44]) t.Logf("found endpoint: %s", endpoint) u, err := url.Parse(endpoint)