Skip to content

Commit

Permalink
Use os.Exit after error
Browse files Browse the repository at this point in the history
Signed-off-by: Omer Aplatony <[email protected]>
  • Loading branch information
omerap12 committed Dec 29, 2024
1 parent ce01f02 commit e097cb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vertical-pod-autoscaler/pkg/utils/vpa/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"
"errors"
"fmt"
"os"
"strings"
"time"

Expand Down Expand Up @@ -91,6 +92,7 @@ func NewVpasLister(vpaClient *vpa_clientset.Clientset, stopChannel <-chan struct
go controller.Run(stopChannel)
if !cache.WaitForCacheSync(make(chan struct{}), controller.HasSynced) {
klog.ErrorS(nil, "Failed to sync VPA cache during initialization")
os.Exit(255)
} else {
klog.InfoS("Initial VPA synced successfully")
}
Expand Down

0 comments on commit e097cb4

Please sign in to comment.