kubeshop / kusk-gateway

Kusk-gateway is an OpenAPI-driven API Gateway for Kubernetes
https://kubeshop.github.io/kusk-gateway/
MIT License
253 stars 21 forks source link

`cmd/kusk/cmd/dashboard.go`: Does not use `dashboardEnvoyFleetExternalPort` #1034

Open mbana opened 1 year ago

mbana commented 1 year ago

https://github.com/kubeshop/kusk-gateway/blob/main/cmd/kusk/cmd/dashboard.go#L158 doesn't use the dashboardEnvoyFleetExternalPort.

If I change it to the below it opens the dashboard when port 8080 has already been allocated but the dashboard at http://localhost:8081/ doesn't show the APIs.

    browserOpenCMD, browserOpenArgs := getBrowserOpenCmdAndArgs(fmt.Sprintf("http://localhost/:%d", dashboardEnvoyFleetExternalPort))`

Hence I am reluctant to make the "fix".

Steps to Reproduce

  1. Apply the fix above to cmd/kusk/cmd/dashboard.go.
  2. Port forward to 8080, e.g., kubectl port-forward --namespace kusk-system services/kusk-gateway-envoy-fleet 8080:80.
  3. Launch dashboard and attempt to browse an API and note that nothing is shown. The command below launches the dashboard and prints the output after applying the "fix". Observe that it has been allocated port 8081:
$ kusk dashboard                                                                 
Forwarding from 127.0.0.1:8081 -> 8080
Forwarding from [::1]:8081 -> 8080
Handling connection for 8081