ricardozanini commented on code in PR #3030:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3030#discussion_r2013062267


##########
packages/sonataflow-operator/cmd/main.go:
##########
@@ -149,6 +152,12 @@ func main() {
        // Set global assessors
        utils.SetIsOpenShift(mgr.GetConfig())
        utils.SetClient(mgr.GetClient())
+       if cli, err := dynamic.NewForConfig(mgr.GetConfig()); err != nil {
+               // shouldn't fail, since config is provided by the cluster, if 
fails, SetIsOpenShift should probably fail before.
+               panic(fmt.Sprintf("Impossible to get new dynamic client for 
config to support controller operations: %s", err))
+       } else {

Review Comment:
   Don't need this `else` since you're panicking. I believe it's clearer to do 
like:
   
   ```
   cli, err := dynamic.NewForConfig(mgr.GetConfig())
   if err != nil {
       panic("\o/")
   }
   utils.SetDynamicClient(cli)
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to