From eba43e83d92b5976d8db43dcc81907d062200d14 Mon Sep 17 00:00:00 2001 From: Hao Li <1127478+lihaosky@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:56:33 -0800 Subject: [PATCH] [hotfix] validate env before getting gateway client (#2973) --- internal/flink/command_connection_list.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/flink/command_connection_list.go b/internal/flink/command_connection_list.go index 15ef59709a..d72808edf2 100644 --- a/internal/flink/command_connection_list.go +++ b/internal/flink/command_connection_list.go @@ -34,11 +34,6 @@ func (c *command) newConnectionListCommand() *cobra.Command { } func (c *command) connectionList(cmd *cobra.Command, _ []string) error { - client, err := c.GetFlinkGatewayClient(false) - if err != nil { - return err - } - environmentId, err := c.Context.EnvironmentId() if err != nil { return err @@ -59,6 +54,11 @@ func (c *command) connectionList(cmd *cobra.Command, _ []string) error { } } + client, err := c.GetFlinkGatewayClient(false) + if err != nil { + return err + } + connections, err := client.ListConnections(environmentId, c.Context.GetCurrentOrganization(), strings.ToUpper(connectionType)) if err != nil { return err