@@ -127,7 +127,8 @@ func main() {
127
127
klog .V (1 ).InfoS ("Vertical Pod Autoscaler Recommender" , "version" , common .VerticalPodAutoscalerVersion , "recommenderName" , * recommenderName )
128
128
129
129
if len (commonFlags .VpaObjectNamespace ) > 0 && len (commonFlags .IgnoredVpaObjectNamespaces ) > 0 {
130
- klog .Fatalf ("--vpa-object-namespace and --ignored-vpa-object-namespaces are mutually exclusive and can't be set together." )
130
+ klog .ErrorS (nil , "--vpa-object-namespace and --ignored-vpa-object-namespaces are mutually exclusive and can't be set together." )
131
+ os .Exit (255 )
131
132
}
132
133
133
134
healthCheck := metrics .NewHealthCheck (* metricsFetcherInterval * 5 )
@@ -140,7 +141,8 @@ func main() {
140
141
} else {
141
142
id , err := os .Hostname ()
142
143
if err != nil {
143
- klog .Fatalf ("Unable to get hostname: %v" , err )
144
+ klog .ErrorS (err , "Unable to get hostname" )
145
+ os .Exit (255 )
144
146
}
145
147
id = id + "_" + string (uuid .NewUUID ())
146
148
@@ -158,7 +160,8 @@ func main() {
158
160
},
159
161
)
160
162
if err != nil {
161
- klog .Fatalf ("Unable to create leader election lock: %v" , err )
163
+ klog .ErrorS (err , "Unable to create leader election lock" )
164
+ os .Exit (255 )
162
165
}
163
166
164
167
leaderelection .RunOrDie (context .TODO (), leaderelection.LeaderElectionConfig {
@@ -266,7 +269,8 @@ func run(healthCheck *metrics.HealthCheck, commonFlag *common.CommonFlags) {
266
269
267
270
promQueryTimeout , err := time .ParseDuration (* queryTimeout )
268
271
if err != nil {
269
- klog .Fatalf ("Could not parse --prometheus-query-timeout as a time.Duration: %v" , err )
272
+ klog .ErrorS (err , "Could not parse --prometheus-query-timeout as a time.Duration" )
273
+ os .Exit (255 )
270
274
}
271
275
272
276
if useCheckpoints {
@@ -293,7 +297,8 @@ func run(healthCheck *metrics.HealthCheck, commonFlag *common.CommonFlags) {
293
297
}
294
298
provider , err := history .NewPrometheusHistoryProvider (config )
295
299
if err != nil {
296
- klog .Fatalf ("Could not initialize history provider: %v" , err )
300
+ klog .ErrorS (err , "Could not initialize history provider" )
301
+ os .Exit (255 )
297
302
}
298
303
recommender .GetClusterStateFeeder ().InitFromHistoryProvider (provider )
299
304
}
0 commit comments