Skip to content

Commit c55d083

Browse files
committed
fix[installer](): remove unnecessary logs
1 parent 772a86f commit c55d083

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

installer/updater/conn.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@ func MonitorConnection(server string, timeSleep time.Duration, maxAttempts int,
1818
_, status, err := utils.DoReq[string](server+config.HealthEndpoint, nil, http.MethodGet, nil, nil)
1919

2020
if err == nil && status == http.StatusOK {
21-
if !messagePrinted {
22-
fmt.Println("Checking Internet Connection: Connection to Internet is available. [OK]")
23-
messagePrinted = true
24-
}
25-
2621
consecutiveErrors = 0
2722
*hasConnection = true
2823
} else {
2924
consecutiveErrors++
3025
if consecutiveErrors >= maxAttempts {
3126
if !messagePrinted {
32-
fmt.Println("Checking Internet Connection: No connection to Internet. Installation will continue without connection to UTMStack Customer Manager.")
27+
fmt.Println("\nNo Internet connection detected. Installation will continue offline.")
3328
messagePrinted = true
3429
}
3530
*hasConnection = false

installer/updater/register.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ func getInstanceInfo() InstanceInfo {
8080
time.Sleep(30 * time.Second)
8181
backConf, err := getConfigFromBackend(6)
8282
if err != nil {
83-
config.Logger().Info("instance info not ready yet, retrying after error: %v", err)
83+
// Only log if it's not a maintenance/backend down error
84+
if !IsBackendMaintenanceError(err) {
85+
config.Logger().Info("instance info not ready yet, retrying after error: %v", err)
86+
}
8487
continue
8588
}
8689

@@ -115,6 +118,10 @@ func updateInstanceInfo(instanceInfo InstanceInfo) error {
115118

116119
backConf, err := getConfigFromBackend(6)
117120
if err != nil {
121+
// If backend is in maintenance, just return without error
122+
if IsBackendMaintenanceError(err) {
123+
return nil
124+
}
118125
return fmt.Errorf("error getting instance auth from backend: %v", err)
119126
}
120127

@@ -126,6 +133,10 @@ func updateInstanceInfo(instanceInfo InstanceInfo) error {
126133

127134
err = updateConfigInBackend(backConf, 6)
128135
if err != nil {
136+
// If backend is in maintenance, just return without error
137+
if IsBackendMaintenanceError(err) {
138+
return nil
139+
}
129140
return fmt.Errorf("error updating instance info in backend: %v", err)
130141
}
131142

0 commit comments

Comments
 (0)