Skip to content

Commit

Permalink
Validate cluster parameter in local proxy (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-de-vera authored Mar 4, 2024
1 parent 049759c commit 4fa5728
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/command/local/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/oklog/run"
"github.com/signadot/cli/internal/config"
clusters "github.com/signadot/go-sdk/client/cluster"
routegroups "github.com/signadot/go-sdk/client/route_groups"
"github.com/signadot/go-sdk/client/sandboxes"
"github.com/signadot/libconnect/common/controlplaneproxy"
Expand Down Expand Up @@ -67,6 +68,12 @@ func runProxy(cmd *cobra.Command, out io.Writer, cfg *config.LocalProxy, args []
cluster = resp.Payload.Spec.Cluster
routingKey = resp.Payload.RoutingKey
} else {
// validate the cluster
params := clusters.NewGetClusterParams().
WithOrgName(cfg.Org).WithClusterName(cfg.Cluster)
if _, err := cfg.Client.Cluster.GetCluster(params, nil); err != nil {
return err
}
cluster = cfg.Cluster
}

Expand Down

0 comments on commit 4fa5728

Please sign in to comment.