ammachado commented on code in PR #3330:
URL: https://github.com/apache/camel-k/pull/3330#discussion_r889640239


##########
pkg/trait/pod_test.go:
##########
@@ -138,6 +150,9 @@ func createPodTest(podSpecTemplate string) (*podTrait, 
*Environment, *appsv1.Dep
                                                        },
                                                },
                                        },
+                                       SecurityContext: 
&corev1.PodSecurityContext{

Review Comment:
   > > The code you've mentioned in pkg/trait/pod_test.go is the "expected" 
deployment after applying the Integration.Spec.PodTemplate.Spec.
   > 
   > Hmm, I don't think so... Looking at the code `pod_test.go`, the returned 
template from `testPodTemplateSpec()` function appears in the "actual" side of 
assertions in all of the tests. Where is it that the deployment returned from 
`createPodTest()` function is used as the "expected" value in an assertion?
   
   Haven't noticed that before, but it is the expected case. The first time 
I've looked at that code I thought that the `Spec` on line 124 should come from 
the `podSpecTemplate` on line 24.  I changed it back then, but some other tests 
were failing, because they're expecting the container "integration" to be 
available (it is default container name for the Camel-K runtime), but it is 
created later during the `kamel run` process, where it applies the `container` 
trait.
   
   This code is just testing the parsing of pod template strings.



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