HoustonPutman commented on code in PR #827:
URL: https://github.com/apache/solr-operator/pull/827#discussion_r4607075681
##########
controllers/util/solr_util.go:
##########
@@ -431,6 +441,19 @@ func GenerateStatefulSet(solrCloud *solr.SolrCloud,
solrCloudStatus *solr.SolrCl
},
}
+ // Solr 10+ reads the listen port from SOLR_PORT_LISTEN instead of
SOLR_PORT,
+ // and uses SOLR_HOST_ADVERTISE in place of the deprecated 'host'
sysprop.
+ // These are only set for Solr 10+, so that pods of older Solr versions
are not restarted by an operator upgrade.
+ if solrCloud.SolrVersionAtLeast(10) {
Review Comment:
This is fine, but we are doing a restart anyways, so we could do this for 9+
##########
controllers/util/solr_security_util.go:
##########
@@ -498,13 +498,20 @@ func useSecureProbe(solrCloud *solr.SolrCloud, probe
*corev1.Probe, mountPath st
// mount the secret in a file so it gets updated; env vars do not see:
//
https://kubernetes.io/docs/concepts/configuration/secret/#environment-variables-are-not-updated-after-a-secret-update
javaToolOptions := make([]string, 0)
+ credentialsArg := ""
if solrCloud.Spec.SolrSecurity != nil &&
solrCloud.Spec.SolrSecurity.ProbesRequireAuth &&
solrCloud.Spec.SolrSecurity.AuthenticationType == solr.Basic {
usernameFile := fmt.Sprintf("%s/%s", mountPath,
corev1.BasicAuthUsernameKey)
passwordFile := fmt.Sprintf("%s/%s", mountPath,
corev1.BasicAuthPasswordKey)
- javaToolOptions = append(javaToolOptions,
- fmt.Sprintf("-Dbasicauth=$(cat %s):$(cat %s)",
usernameFile, passwordFile),
-
"-Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory",
- )
+ if solrCloud.SolrVersionAtLeast(10) {
+ // Solr 10 removed the
PreemptiveBasicAuthClientBuilderFactory used with JAVA_TOOL_OPTIONS below, so
pass the credentials as an argument.
+ // This makes them visible in the process arguments
inside the pod.
+ credentialsArg = fmt.Sprintf(` --credentials "$(cat
%s):$(cat %s)"`, usernameFile, passwordFile)
Review Comment:
Well this isn't great. We need to have the ability for these values to be
backed by files. (hopefully something other than files too).
--
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]