chia7712 commented on code in PR #850:
URL: https://github.com/apache/yunikorn-k8shim/pull/850#discussion_r1617555731


##########
pkg/admission/conf/am_conf.go:
##########
@@ -118,7 +119,11 @@ func NewAdmissionControllerConf(configMaps 
[]*v1.ConfigMap) *AdmissionController
 }
 
 func (acc *AdmissionControllerConf) RegisterHandlers(configMaps 
informersv1.ConfigMapInformer) {
-       configMaps.Informer().AddEventHandler(&configMapUpdateHandler{conf: 
acc})
+       _, err := 
configMaps.Informer().AddEventHandler(&configMapUpdateHandler{conf: acc})
+       if err != nil {
+               log.Log(log.AdmissionConf).Fatal("Failed to create Register 
handler", zap.Error(err))
+               os.Exit(1)

Review Comment:
   > Another question: what about the cleanup here?
   
   It seems to me propagating the error to callers allow them to do more 
actions. For example, log with more details or sent event or release resources. 
At any rate, exiting program in the middle of call chain is anti-pattern to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to