Skip to content

Commit 26ae193

Browse files
nitishtAdheipSingh
andauthored
update install command (#77)
Co-authored-by: AdheipSingh <[email protected]>
1 parent 344cb2d commit 26ae193

File tree

3 files changed

+70
-141
lines changed

3 files changed

+70
-141
lines changed

cmd/installer.go

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@ import (
77
"net"
88
"os"
99
"os/exec"
10-
"pb/pkg/common"
11-
"pb/pkg/helm"
12-
"pb/pkg/installer"
1310
"runtime"
1411
"strings"
1512
"sync"
1613
"time"
1714

15+
"pb/pkg/common"
16+
"pb/pkg/helm"
17+
"pb/pkg/installer"
18+
1819
"github.com/briandowns/spinner"
1920
"github.com/spf13/cobra"
2021
)
2122

22-
var (
23-
verbose bool
24-
)
23+
var verbose bool
2524

2625
var InstallOssCmd = &cobra.Command{
2726
Use: "oss",
@@ -40,10 +39,12 @@ var InstallOssCmd = &cobra.Command{
4039
return err
4140
}
4241

43-
fmt.Println(common.Green + "You selected the following plan:" + common.Reset)
44-
fmt.Printf(common.Cyan+"Plan: %s\n"+common.Yellow+"Ingestion Speed: %s\n"+common.Green+"Per Day Ingestion: %s\n"+
45-
common.Blue+"Query Performance: %s\n"+common.Red+"CPU & Memory: %s\n"+common.Reset,
46-
selectedPlan.Name, selectedPlan.IngestionSpeed, selectedPlan.PerDayIngestion,
42+
fmt.Printf(
43+
common.Cyan+" Ingestion Speed: %s\n"+
44+
common.Cyan+" Per Day Ingestion: %s\n"+
45+
common.Cyan+" Query Performance: %s\n"+
46+
common.Cyan+" CPU & Memory: %s\n"+
47+
common.Reset, selectedPlan.IngestionSpeed, selectedPlan.PerDayIngestion,
4748
selectedPlan.QueryPerformance, selectedPlan.CPUAndMemorySpecs)
4849

4950
// Get namespace and chart values from installer
@@ -95,7 +96,6 @@ var InstallOssCmd = &cobra.Command{
9596
// Stop the spinner and restore stdout
9697
spinner.Stop()
9798
if !verbose {
98-
//w.Close()
9999
os.Stdout = oldStdout
100100
}
101101

@@ -115,12 +115,12 @@ var InstallOssCmd = &cobra.Command{
115115

116116
// printSuccessBanner remains the same as in the original code
117117
func printSuccessBanner(namespace, deployment, version, username, password string) {
118-
var ingestionUrl, serviceName string
118+
var ingestionURL, serviceName string
119119
if deployment == "standalone" {
120-
ingestionUrl = "parseable." + namespace + ".svc.cluster.local"
120+
ingestionURL = "parseable." + namespace + ".svc.cluster.local"
121121
serviceName = "parseable"
122122
} else if deployment == "distributed" {
123-
ingestionUrl = "parseable-ingestor-svc." + namespace + ".svc.cluster.local"
123+
ingestionURL = "parseable-ingestor-svc." + namespace + ".svc.cluster.local"
124124
serviceName = "parseable-query-svc"
125125
}
126126

@@ -143,7 +143,7 @@ func printSuccessBanner(namespace, deployment, version, username, password strin
143143
fmt.Printf("%s Deployment Details:\n", common.Blue+"ℹ️ ")
144144
fmt.Printf(" • Namespace: %s\n", common.Blue+namespace)
145145
fmt.Printf(" • Chart Version: %s\n", common.Blue+version)
146-
fmt.Printf(" • Ingestion URL: %s\n", ingestionUrl)
146+
fmt.Printf(" • Ingestion URL: %s\n", ingestionURL)
147147

148148
fmt.Println("\n" + common.Blue + "🔗 Resources:" + common.Reset)
149149
fmt.Println(common.Blue + " • Documentation: https://www.parseable.com/docs/server/introduction")
@@ -155,16 +155,14 @@ func printSuccessBanner(namespace, deployment, version, username, password strin
155155
localPort := "8000"
156156
fmt.Printf(common.Green+"Port-forwarding %s service on port %s...\n"+common.Reset, serviceName, localPort)
157157

158-
err = startPortForward(namespace, serviceName, "80", localPort)
159-
if err != nil {
160-
fmt.Errorf(common.Red+"failed to port-forward service: %w", err)
158+
if err = startPortForward(namespace, serviceName, "80", localPort); err != nil {
159+
fmt.Printf(common.Red+"failed to port-forward service: %s", err.Error())
161160
}
162161

163162
// Redirect to UI
164163
localURL := fmt.Sprintf("http://localhost:%s/login?q=%s", localPort, base64EncodedString)
165164
fmt.Printf(common.Green+"Opening Parseable UI at %s\n"+common.Reset, localURL)
166165
openBrowser(localURL)
167-
168166
}
169167

170168
func createDeploymentSpinner(namespace string) *spinner.Spinner {

0 commit comments

Comments
 (0)