jasonkingatconversocial commented on code in PR #660:
URL: https://github.com/apache/solr-operator/pull/660#discussion_r1570931828


##########
controllers/util/solr_security_util.go:
##########
@@ -238,7 +238,7 @@ func addHostHeaderToProbe(httpGet *corev1.HTTPGetAction, 
host string) {
 
 func cmdToPutSecurityJsonInZk() string {
        scriptsDir := "/opt/solr/server/scripts/cloud-scripts"
-       cmd := " ZK_SECURITY_JSON=$(%s/zkcli.sh -zkhost ${ZK_HOST} -cmd get 
/security.json); "
+       cmd := " ZK_SECURITY_JSON=$(%s/zkcli.sh -zkhost ${ZK_HOST} -cmd get 
/security.json || echo 'failed-to-get-security.json'); "

Review Comment:
   @HoustonPutman 
   This change appears to cause `SolrCloud` pods to be restarted upon upgrade 
of the operator. Should this be expected for a patch release; it's not 
mentioned in the release notes at 
https://apache.github.io/solr-operator/docs/upgrade-notes.html ?
   ```
   2024-04-18T14:04:15Z INFO    Update required because field changed   
{"controller": "solrcloud", "controllerGroup": "solr.apache.org", 
"controllerKind": "SolrCloud", "SolrCloud": 
{"name":"solrcloud-test-2","namespace":"solrcloud-test-2"}, "namespace": 
"solrcloud-test-2", "name": "solrcloud-test-2", "reconcileID": 
"8e7b7ebc-4536-4c7e-828a-2c65142f77b9", "statefulSet": 
"solrcloud-test-2-solrcloud", "kind": "statefulSet", "field": 
"Spec.Template.Spec.InitContainers[1].Command", 
   "from": ["sh", "-c", " 
ZK_SECURITY_JSON=$(/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 
${ZK_HOST} -cmd get /security.json); if [ ${#ZK_SECURITY_JSON} -lt 3 ]; then 
echo $SECURITY_JSON > /tmp/security.json; 
/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"], 
   "to":   ["sh", "-c", " 
ZK_SECURITY_JSON=$(/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 
${ZK_HOST} -cmd get /security.json || echo 'failed-to-get-security.json'); if [ 
${#ZK_SECURITY_JSON} -lt 3 ]; then echo $SECURITY_JSON > /tmp/security.json; 
/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"]}
   ```



##########
controllers/solrcloud_controller_basic_auth_test.go:
##########
@@ -350,7 +351,7 @@ func expectBasicAuthConfigOnPodTemplateWithGomega(g Gomega, 
solrCloud *solrv1bet
 
 func expectPutSecurityJsonInZkCmd(g Gomega, expInitContainer 
*corev1.Container) {
        g.Expect(expInitContainer).To(Not(BeNil()), "Didn't find the setup-zk 
InitContainer in the sts!")
-       expCmd := 
"ZK_SECURITY_JSON=$(/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 
${ZK_HOST} -cmd get /security.json); " +
+       expCmd := 
"ZK_SECURITY_JSON=$(/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 
${ZK_HOST} -cmd get /security.json || echo 'failed-to-get-security.json'); " +

Review Comment:
   @HoustonPutman 
   This change appears to cause `SolrCloud` pods to be restarted upon upgrade 
of the operator. Should this be expected for a patch release; it's not 
mentioned in the release notes at 
https://apache.github.io/solr-operator/docs/upgrade-notes.html ?
   ```
   2024-04-18T14:04:15Z INFO    Update required because field changed   
{"controller": "solrcloud", "controllerGroup": "solr.apache.org", 
"controllerKind": "SolrCloud", "SolrCloud": 
{"name":"solrcloud-test-2","namespace":"solrcloud-test-2"}, "namespace": 
"solrcloud-test-2", "name": "solrcloud-test-2", "reconcileID": 
"8e7b7ebc-4536-4c7e-828a-2c65142f77b9", "statefulSet": 
"solrcloud-test-2-solrcloud", "kind": "statefulSet", "field": 
"Spec.Template.Spec.InitContainers[1].Command", 
   "from": ["sh", "-c", " 
ZK_SECURITY_JSON=$(/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 
${ZK_HOST} -cmd get /security.json); if [ ${#ZK_SECURITY_JSON} -lt 3 ]; then 
echo $SECURITY_JSON > /tmp/security.json; 
/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"], 
   "to":   ["sh", "-c", " 
ZK_SECURITY_JSON=$(/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 
${ZK_HOST} -cmd get /security.json || echo 'failed-to-get-security.json'); if [ 
${#ZK_SECURITY_JSON} -lt 3 ]; then echo $SECURITY_JSON > /tmp/security.json; 
/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"]}
   ```



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