This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new f1d39a39 Document solr.xml elements that a custom solr.xml must carry 
itself (#890)
f1d39a39 is described below

commit f1d39a394fb40cdcb1d58b304dff9c549b01dd22
Author: Jan Høydahl <[email protected]>
AuthorDate: Tue Nov 10 01:12:27 2026 +0100

    Document solr.xml elements that a custom solr.xml must carry itself (#890)
---
 .../solr-backup/pages/backup-repositories.adoc     |  4 ++++
 .../solr-cloud/pages/custom-solr-config.adoc       | 23 ++++++++++++++++++++++
 docs/modules/solr-cloud/pages/solr-cloud-crd.adoc  |  4 ++++
 3 files changed, 31 insertions(+)

diff --git a/docs/modules/solr-backup/pages/backup-repositories.adoc 
b/docs/modules/solr-backup/pages/backup-repositories.adoc
index cb4103b1..6d910b59 100644
--- a/docs/modules/solr-backup/pages/backup-repositories.adoc
+++ b/docs/modules/solr-backup/pages/backup-repositories.adoc
@@ -20,6 +20,10 @@ Note all repositories are defined in the `SolrCloud` 
specification.
 In order to use a repository in the `SolrBackup` CRD, it must be defined in 
the `SolrCloud` spec.
 All yaml examples below are `SolrCloud` resources, not `SolrBackup` resources.
 
+NOTE: The operator registers the repositories with Solr through a `<backup>` 
element in the `solr.xml` it generates.
+If you provide your own `solr.xml` through `providedConfigMap`, you must add 
the `<backup>` element and the repository modules to your custom `solr.xml` 
yourself.
+See xref:solr-cloud:custom-solr-config.adoc#solr-xml-managed-elements[Elements 
the operator normally generates for you].
+
 The Solr-operator currently supports three different backup repository types: 
Google Cloud Storage ("GCS"), AWS S3 ("S3"), and Volume ("local").
 The cloud backup solutions (GCS and S3) are strongly suggested as they are 
cloud-native backup solutions, however they require newer Solr versions.
 
diff --git a/docs/modules/solr-cloud/pages/custom-solr-config.adoc 
b/docs/modules/solr-cloud/pages/custom-solr-config.adoc
index eda4955c..9d3151c8 100644
--- a/docs/modules/solr-cloud/pages/custom-solr-config.adoc
+++ b/docs/modules/solr-cloud/pages/custom-solr-config.adoc
@@ -106,6 +106,29 @@ spec:
 
 NOTE: If you set `providedConfigMap`, then the ConfigMap must include the 
`solr.xml` or `log4j2.xml` key, otherwise the SolrCloud will fail to reconcile.
 
+[#solr-xml-managed-elements]
+=== Elements the operator normally generates for you
+
+Some SolrCloud settings only work by adding elements to the `solr.xml` that 
the operator generates:
+`spec.solrModules` and `spec.additionalLibs` are written into the `sharedLib` 
element, and `spec.backupRepositories` into the `<backup>` element.
+The operator never modifies a user-provided `solr.xml`, so with a custom 
`solr.xml` these settings have no effect and you must add the elements yourself.
+
+The simplest approach is to configure these settings first, then copy the 
generated `solr.xml` as described above and customize from there.
+The relevant elements look like this for one module and one S3 repository:
+
+[source,xml]
+----
+<str 
name="sharedLib">${solr.sharedLib:},/opt/solr/contrib/analysis-extras/lib,/opt/solr/contrib/s3-repository/lib,/opt/solr/dist</str>
+<backup>
+  <repository name="s3-backups" class="org.apache.solr.s3.S3BackupRepository">
+    <str name="s3.bucket.name">my-bucket</str>
+    <str name="s3.region">us-east-1</str>
+  </repository>
+</backup>
+----
+
+Keeping the `${solr.sharedLib:}` placeholder lets you set the library paths 
with `-Dsolr.sharedLib=...` in `solrOpts` instead of editing the XML.
+
 === Changes to Custom Config Trigger Rolling Restarts
 
 The Solr operator stores the MD5 hash of your custom XML in the StatefulSet's 
pod spec annotations (`spec.template.metadata.annotations`). To see the current 
annotations for your Solr pods, you can do:
diff --git a/docs/modules/solr-cloud/pages/solr-cloud-crd.adoc 
b/docs/modules/solr-cloud/pages/solr-cloud-crd.adoc
index 07b37b3a..d77dcc58 100644
--- a/docs/modules/solr-cloud/pages/solr-cloud-crd.adoc
+++ b/docs/modules/solr-cloud/pages/solr-cloud-crd.adoc
@@ -45,6 +45,10 @@ Use the **`SolrCloud.spec.solrModules`** property to add a 
list of module names,
 However, users might want to include custom code that is not an official Solr 
Module.
 In order to facilitate this, the **`SolrCloud.spec.additionalLibs`** property 
takes a list of paths to folders, containing jars to load in the classpath of 
the SolrCloud.
 
+NOTE: Both properties work by adding a `sharedLib` element to the `solr.xml` 
that the operator generates.
+If you provide your own `solr.xml` through `providedConfigMap`, they have no 
effect, and you must list the library directories in your custom `solr.xml` 
yourself.
+See xref:custom-solr-config.adoc#solr-xml-managed-elements[Elements the 
operator normally generates for you].
+
 == Data Storage
 
 The SolrCloud CRD gives the option for users to use either

Reply via email to