@@ -7,21 +7,20 @@ import (
7
7
"net"
8
8
"os"
9
9
"os/exec"
10
- "pb/pkg/common"
11
- "pb/pkg/helm"
12
- "pb/pkg/installer"
13
10
"runtime"
14
11
"strings"
15
12
"sync"
16
13
"time"
17
14
15
+ "pb/pkg/common"
16
+ "pb/pkg/helm"
17
+ "pb/pkg/installer"
18
+
18
19
"github.com/briandowns/spinner"
19
20
"github.com/spf13/cobra"
20
21
)
21
22
22
- var (
23
- verbose bool
24
- )
23
+ var verbose bool
25
24
26
25
var InstallOssCmd = & cobra.Command {
27
26
Use : "oss" ,
@@ -40,10 +39,12 @@ var InstallOssCmd = &cobra.Command{
40
39
return err
41
40
}
42
41
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 ,
47
48
selectedPlan .QueryPerformance , selectedPlan .CPUAndMemorySpecs )
48
49
49
50
// Get namespace and chart values from installer
@@ -95,7 +96,6 @@ var InstallOssCmd = &cobra.Command{
95
96
// Stop the spinner and restore stdout
96
97
spinner .Stop ()
97
98
if ! verbose {
98
- //w.Close()
99
99
os .Stdout = oldStdout
100
100
}
101
101
@@ -115,12 +115,12 @@ var InstallOssCmd = &cobra.Command{
115
115
116
116
// printSuccessBanner remains the same as in the original code
117
117
func printSuccessBanner (namespace , deployment , version , username , password string ) {
118
- var ingestionUrl , serviceName string
118
+ var ingestionURL , serviceName string
119
119
if deployment == "standalone" {
120
- ingestionUrl = "parseable." + namespace + ".svc.cluster.local"
120
+ ingestionURL = "parseable." + namespace + ".svc.cluster.local"
121
121
serviceName = "parseable"
122
122
} else if deployment == "distributed" {
123
- ingestionUrl = "parseable-ingestor-svc." + namespace + ".svc.cluster.local"
123
+ ingestionURL = "parseable-ingestor-svc." + namespace + ".svc.cluster.local"
124
124
serviceName = "parseable-query-svc"
125
125
}
126
126
@@ -143,7 +143,7 @@ func printSuccessBanner(namespace, deployment, version, username, password strin
143
143
fmt .Printf ("%s Deployment Details:\n " , common .Blue + "ℹ️ " )
144
144
fmt .Printf (" • Namespace: %s\n " , common .Blue + namespace )
145
145
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 )
147
147
148
148
fmt .Println ("\n " + common .Blue + "🔗 Resources:" + common .Reset )
149
149
fmt .Println (common .Blue + " • Documentation: https://www.parseable.com/docs/server/introduction" )
@@ -155,16 +155,14 @@ func printSuccessBanner(namespace, deployment, version, username, password strin
155
155
localPort := "8000"
156
156
fmt .Printf (common .Green + "Port-forwarding %s service on port %s...\n " + common .Reset , serviceName , localPort )
157
157
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 ())
161
160
}
162
161
163
162
// Redirect to UI
164
163
localURL := fmt .Sprintf ("http://localhost:%s/login?q=%s" , localPort , base64EncodedString )
165
164
fmt .Printf (common .Green + "Opening Parseable UI at %s\n " + common .Reset , localURL )
166
165
openBrowser (localURL )
167
-
168
166
}
169
167
170
168
func createDeploymentSpinner (namespace string ) * spinner.Spinner {
0 commit comments