pkalsi97 commented on code in PR #6441:
URL: https://github.com/apache/camel-k/pull/6441#discussion_r2701446711


##########
pkg/trait/init_containers.go:
##########
@@ -92,19 +92,39 @@ func (t *initContainersTrait) Configure(e *Environment) 
(bool, *TraitCondition,
                        t.tasks = append(t.tasks, agentDownloadTask)
                }
                // Set the CA cert truststore init container if configured
-               if ok && jvm.hasCACert() {
-                       if err := jvm.validateCACertConfig(); err != nil {
-                               return false, nil, err
+               if ok && jvm.hasCACerts() {
+                       var allCommands []string
+
+                       var truststorePassPath string
+                       if jvm.hasBaseTruststore() {
+                               baseTruststore := jvm.getBaseTruststore()
+                               truststorePassPath = baseTruststore.PasswordPath
+                               copyCmd := fmt.Sprintf("cp %s %s", 
baseTruststore.TruststorePath, jvm.getTrustStorePath())
+                               allCommands = append(allCommands, copyCmd)
+                       } else {
+                               certEntries := jvm.getAllCACertEntries()
+                               if len(certEntries) > 0 {
+                                       truststorePassPath = 
certEntries[0].PasswordPath

Review Comment:
   @squakez this makes sense, there can be a case where certs are reordered and 
this would cause confusion and secondly yes this is an implicit implementations 
where user might not be even aware that first cert's password is 
trustStorePassword. 



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