wmedvede commented on code in PR #283:
URL: 
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/283#discussion_r1390835460


##########
utils/kubernetes/deployment.go:
##########
@@ -111,6 +111,21 @@ func GetContainerByName(name string, podSpec *v1.PodSpec) 
(*v1.Container, int) {
        return nil, -1
 }
 
+// GetContainerPortByName returns a pointer to the ContainerPort within the 
given Container.
+// If none found, returns nil.
+// It also returns the position where the container port was found, -1 if none.
+func GetContainerPortByName(name string, container *v1.Container) 
(*v1.ContainerPort, int) {
+       if container == nil {

Review Comment:
   I think we have here different programming style, and really no criteria 
used around the project in general.
   Let me explain, the intention here is that you don't have to wait to the end 
of the function to know what happens, instead, as soon you know the container 
is null, you don't need to read the remainder of the code, you know directly 
what the result should be.  As said, it correspond to a programming styling, 
all variants are good.
   For this particular file, we had already a function GetContainerByName 
https://github.com/apache/incubator-kie-kogito-serverless-operator/blob/1eb14dfcd37705ebcb7c60342063bf3f438532a0/utils/kubernetes/deployment.go#L102,
 that uses this style.
   I you don't mind, I'd prefer to follow same pattern for a similar function.
   
   
   



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