diff --git a/cli/README.md b/cli/README.md index f88b6f0ab..5dd208131 100644 --- a/cli/README.md +++ b/cli/README.md @@ -6,8 +6,8 @@ | flag | default | purpose | |----------------------|------------------|--------------------------------------------------------------------------------------------------------------| -| `--no-dashboard` | `false` | Don't host the dashboard (not applicable at the moment) | -| `--dashboard-port` | `8899` | local port that dashboard will be forwarded to | +| `--no-gui` | `false` | Don't host the web interface (not applicable at the moment) | +| `--gui-port` | `8899` | local port that web interface will be forwarded to | | `--namespace` | | use namespace different than the one found in kubeconfig | | `--kubeconfig` | | Path to custom kubeconfig file | diff --git a/cli/cmd/fetch.go b/cli/cmd/fetch.go index 3dcb1ff00..24ed884db 100644 --- a/cli/cmd/fetch.go +++ b/cli/cmd/fetch.go @@ -1,7 +1,7 @@ package cmd import ( - "errors" + "fmt" "github.com/spf13/cobra" ) @@ -10,7 +10,8 @@ var fetchCmd = &cobra.Command{ Use: "fetch", Short: "Download recorded traffic", RunE: func(cmd *cobra.Command, args []string) error { - return errors.New("Not implemented") + fmt.Println("Not implemented") + return nil }, } diff --git a/cli/cmd/tap.go b/cli/cmd/tap.go index 4eb71244e..6de369e8d 100644 --- a/cli/cmd/tap.go +++ b/cli/cmd/tap.go @@ -31,9 +31,9 @@ var tapCmd = &cobra.Command{ func init() { rootCmd.AddCommand(tapCmd) - tapCmd.Flags().BoolVarP(&config.Configuration.Quiet, "quiet", "q", false, "No stdout output") - tapCmd.Flags().BoolVarP(&config.Configuration.NoDashboard, "no-dashboard", "", false, "Dont host a dashboard") - tapCmd.Flags().Uint16VarP(&config.Configuration.DashboardPort, "dashboard-port", "p", 8899, "Provide a custom port for the dashboard webserver") + // tapCmd.Flags().BoolVarP(&config.Configuration.Quiet, "quiet", "q", false, "No stdout output") + tapCmd.Flags().BoolVarP(&config.Configuration.NoGUI, "no-gui", "", false, "Do not open web interface") + tapCmd.Flags().Uint16VarP(&config.Configuration.GuiPort, "gui-port", "p", 8899, "Provide a custom port for the web interface webserver") tapCmd.Flags().StringVarP(&config.Configuration.Namespace, "namespace", "n", "", "Namespace selector") // tapCmd.Flags().BoolVarP(&config.Configuration.AllNamespaces, "all-namespaces", "A", false, "Select all namespaces") tapCmd.Flags().StringVarP(&config.Configuration.KubeConfigPath, "kubeconfig", "k", "", "Path to kubeconfig file") diff --git a/cli/cmd/view.go b/cli/cmd/view.go index 6ab02336f..19fdfea44 100644 --- a/cli/cmd/view.go +++ b/cli/cmd/view.go @@ -1,7 +1,7 @@ package cmd import ( - "errors" + "fmt" "github.com/spf13/cobra" ) @@ -10,7 +10,8 @@ var viewCmd = &cobra.Command{ Use: "view", Short: "Open GUI in browser", RunE: func(cmd *cobra.Command, args []string) error { - return errors.New("Not implemented") + fmt.Println("Not implemented") + return nil }, } diff --git a/cli/config/config.go b/cli/config/config.go index d789ad31c..6183d8ebf 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -1,11 +1,9 @@ package config type Options struct { - Quiet bool - NoDashboard bool - DashboardPort uint16 + NoGUI bool + GuiPort uint16 Namespace string - AllNamespaces bool KubeConfigPath string MizuImage string MizuPodPort uint16 diff --git a/cli/mizu/mizuRunner.go b/cli/mizu/mizuRunner.go index e54ec947e..ca015d91e 100644 --- a/cli/mizu/mizuRunner.go +++ b/cli/mizu/mizuRunner.go @@ -75,9 +75,9 @@ func createPodAndPortForward(ctx context.Context, kubernetesProvider *kubernetes if modifiedPod.Status.Phase == "Running" && !isPodReady { isPodReady = true var err error - portForward, err = kubernetes.NewPortForward(kubernetesProvider, kubernetesProvider.Namespace, podName, config.Configuration.DashboardPort, config.Configuration.MizuPodPort, cancel) - if !config.Configuration.NoDashboard { - fmt.Printf("Dashboard is now available at http://localhost:%d\n", config.Configuration.DashboardPort) + portForward, err = kubernetes.NewPortForward(kubernetesProvider, kubernetesProvider.Namespace, podName, config.Configuration.GuiPort, config.Configuration.MizuPodPort, cancel) + if !config.Configuration.NoGUI { + fmt.Printf("Web interface is now available at http://localhost:%d\n", config.Configuration.GuiPort) } if err != nil { fmt.Printf("error forwarding port to pod %s\n", err)