Skip to content

Commit

Permalink
move houston version API call to only when context is not Astro (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
neel-astro authored Jul 5, 2023
1 parent 09f02c3 commit f6adffb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ func NewRootCmd() *cobra.Command {
var err error
httpClient := houston.NewHTTPClient()
houstonClient = houston.NewClient(httpClient)
houstonVersion, err = houstonClient.GetPlatformVersion(nil)
if err != nil {
softwareCmd.InitDebugLogs = append(softwareCmd.InitDebugLogs, fmt.Sprintf("Unable to get Houston version: %s", err.Error()))
}

airflowClient := airflowclient.NewAirflowClient(httputil.NewHTTPClient())
astroClient := astro.NewAstroClient(httputil.NewHTTPClient())
Expand All @@ -52,6 +48,10 @@ func NewRootCmd() *cobra.Command {
isCloudCtx := context.IsCloudContext()
if !isCloudCtx {
ctx = softwarePlatform
houstonVersion, err = houstonClient.GetPlatformVersion(nil)
if err != nil {
softwareCmd.InitDebugLogs = append(softwareCmd.InitDebugLogs, fmt.Sprintf("Unable to get Houston version: %s", err.Error()))
}
}

rootCmd := &cobra.Command{
Expand Down

0 comments on commit f6adffb

Please sign in to comment.