Skip to content

Commit 2bbae61

Browse files
committed
add error check
1 parent 2395593 commit 2bbae61

File tree

1 file changed

+8
-2
lines changed
  • cmd/katib-controller/v1beta1

1 file changed

+8
-2
lines changed

cmd/katib-controller/v1beta1/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,15 @@ func main() {
136136
}
137137

138138
log.Info("Setting up health checker.")
139-
mgr.AddHealthzCheck("healthz", healthz.Ping)
139+
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
140+
log.Error(err, "Unable to add healthz endpoint to the manager")
141+
os.Exit(1)
142+
}
140143
// TODO (@anencore94) need to more detailed check whether is it possible to communicate with k8s-apiserver or db-manager at '/readyz' ?
141-
mgr.AddReadyzCheck("readyz", healthz.Ping)
144+
if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil {
145+
log.Error(err, "Unable to add readyz endpoint to the manager")
146+
os.Exit(1)
147+
}
142148

143149
// Start the Cmd
144150
log.Info("Starting the Cmd.")

0 commit comments

Comments
 (0)