Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: xiaopeng <hanxiaop8@outlook.com>
  • Loading branch information
hanxiaop committed Feb 22, 2024
1 parent 15c3d86 commit 85b1375
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Binary file added egctl
Binary file not shown.
9 changes: 5 additions & 4 deletions internal/cmd/egctl/envoy_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import (
"os/signal"
"runtime"

kube "github.com/envoyproxy/gateway/internal/kubernetes"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types"

kube "github.com/envoyproxy/gateway/internal/kubernetes"
)

func newEnvoyDashboardCmd() *cobra.Command {
Expand Down Expand Up @@ -56,7 +57,7 @@ func newEnvoyDashboardCmd() *cobra.Command {
if len(labelSelectors) > 0 {
pl, err := kubeClient.PodsForSelector(podNamespace, labelSelectors...)
if err != nil {
return fmt.Errorf("not able to locate pod with selector %s: %v", labelSelectors, err)
return fmt.Errorf("not able to locate pod with selector %s: %w", labelSelectors, err)
}
if len(pl.Items) < 1 {
return errors.New("no pods found")
Expand Down Expand Up @@ -84,12 +85,12 @@ func portForward(podName, namespace, urlFormat string, listenPort int, client ku
}
fw, err := kube.NewLocalPortForwarder(client, meta, listenPort, adminPort)
if err != nil {
return fmt.Errorf("could not build port forwarder for envoy proxy: %v", err)
return fmt.Errorf("could not build port forwarder for envoy proxy: %w", err)
}

if err = fw.Start(); err != nil {
fw.Stop()
return fmt.Errorf("could not start port forwarder for envoy proxy: %v", err)
return fmt.Errorf("could not start port forwarder for envoy proxy: %w", err)
}

ClosePortForwarderOnInterrupt(fw)
Expand Down

0 comments on commit 85b1375

Please sign in to comment.