thelabdude commented on a change in pull request #221:
URL: 
https://github.com/apache/lucene-solr-operator/pull/221#discussion_r577998973



##########
File path: controllers/util/solr_util.go
##########
@@ -971,10 +991,26 @@ func generateZKInteractionInitContainer(solrCloud 
*solr.SolrCloud, solrCloudStat
                })
        }
 
+       cmd := ""
+
        if solrCloud.Spec.SolrTLS != nil {
-               cmd := "solr zk ls ${ZK_CHROOT} -z ${ZK_SERVER} || solr zk 
mkroot ${ZK_CHROOT} -z ${ZK_SERVER}" +
+               cmd = "solr zk ls ${ZK_CHROOT} -z ${ZK_SERVER} || solr zk 
mkroot ${ZK_CHROOT} -z ${ZK_SERVER}" +
                        "; /opt/solr/server/scripts/cloud-scripts/zkcli.sh 
-zkhost ${ZK_HOST} -cmd clusterprop -name urlScheme -val https" +
                        "; /opt/solr/server/scripts/cloud-scripts/zkcli.sh 
-zkhost ${ZK_HOST} -cmd get /clusterprops.json"
+       }
+
+       volumeMounts := []corev1.VolumeMount{}
+       if configMapInfo[SecurityJsonFile] != "" {
+               // mount security.json from the ConfigMap at /tmp/security.json
+               volumeMounts = append(volumeMounts, corev1.VolumeMount{Name: 
"security-json", MountPath: "/tmp"})
+               if cmd == "" {
+                       cmd += "solr zk ls ${ZK_CHROOT} -z ${ZK_SERVER} || solr 
zk mkroot ${ZK_CHROOT} -z ${ZK_SERVER}; "
+               }
+               cmd += 
"ZK_SECURITY_JSON=$(/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 
${ZK_HOST} -cmd get /security.json); "
+               cmd += "if [ ${#ZK_SECURITY_JSON} -lt 3 ]; then 
/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost ${ZK_HOST} -cmd putfile 
/security.json /tmp/security.json; echo \"put security.json in ZK\"; fi"

Review comment:
       haha ... don't laugh at this ;-) it was the easiest way to check if the 
znode data is empty "" or {} using /bin/sh




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to