From f7bbea525add442fa06bd28160ada0a1b166ab7f Mon Sep 17 00:00:00 2001 From: nicufk Date: Wed, 29 May 2024 11:08:40 +0300 Subject: [PATCH] fix: port-forward minio when opening the dashboard for enterprise (#5483) --- cmd/kubectl-testkube/commands/dashboard.go | 6 +++++ cmd/kubectl-testkube/config/storage.go | 27 ++++++++++++---------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/cmd/kubectl-testkube/commands/dashboard.go b/cmd/kubectl-testkube/commands/dashboard.go index 26194e024db..e8845b4346d 100644 --- a/cmd/kubectl-testkube/commands/dashboard.go +++ b/cmd/kubectl-testkube/commands/dashboard.go @@ -85,6 +85,12 @@ func openOnPremDashboard(cmd *cobra.Command, cfg config.Data, verbose bool, lice } ui.ExitOnError("port forwarding dex", err) + err = k8sclient.PortForward(ctx, cfg.Namespace, config.EnterpriseMinioName, config.EnterpriseMinioPort, config.EnterpriseMinioPortFrwardingPort, verbose) + if err != nil { + errs = append(errs, err) + } + ui.PrintOnError("port forwarding minio", err) + err = open.Run(uri) if err != nil { sendErrTelemetry(cmd, cfg, "open_dashboard", license, "opening dashboard", err) diff --git a/cmd/kubectl-testkube/config/storage.go b/cmd/kubectl-testkube/config/storage.go index fc11c1a502f..236ba86a6e8 100644 --- a/cmd/kubectl-testkube/config/storage.go +++ b/cmd/kubectl-testkube/config/storage.go @@ -9,18 +9,21 @@ import ( ) const ( - APIServerName string = "testkube-api-server" - APIServerPort int = 8088 - DashboardName string = "testkube-dashboard" - DashboardPort int = 8080 - EnterpriseUiName string = "testkube-enterprise-ui" - EnterpriseUiPort int = 8080 - EnterpriseApiName string = "testkube-enterprise-api" - EnterpriseApiPort int = 8088 - EnterpriseApiForwardingPort int = 8090 - EnterpriseDexName string = "testkube-enterprise-dex" - EnterpriseDexPort int = 5556 - EnterpriseDexForwardingPort int = 5556 + APIServerName string = "testkube-api-server" + APIServerPort int = 8088 + DashboardName string = "testkube-dashboard" + DashboardPort int = 8080 + EnterpriseUiName string = "testkube-enterprise-ui" + EnterpriseUiPort int = 8080 + EnterpriseApiName string = "testkube-enterprise-api" + EnterpriseApiPort int = 8088 + EnterpriseApiForwardingPort int = 8090 + EnterpriseDexName string = "testkube-enterprise-dex" + EnterpriseDexPort int = 5556 + EnterpriseDexForwardingPort int = 5556 + EnterpriseMinioName string = "testkube-enterprise-minio" + EnterpriseMinioPort int = 9000 + EnterpriseMinioPortFrwardingPort int = 9000 configDirName = ".testkube" configFile = "config.json"