danielmeint opened a new pull request, #827:
URL: https://github.com/apache/solr-operator/pull/827
## Summary
Adds version-conditional support for Solr 10 to the operator while
preserving full backwards compatibility with Solr 9.x. With this change, all
major operator-managed flows (cluster bootstrap, scaling, security, TLS,
backups, ingress, rolling upgrades) work against a Solr 10.0 image.
This builds on the partial fix proposed in #826 and addresses #821 (\"Solr
10.0 - No tests pass\"). The Prometheus exporter is intentionally out of scope
— `solr-exporter` was removed from the Solr distribution in 10, see #820.
## What changed
Version detection is centralized on the `SolrCloud` type:
- `(*SolrCloud).IsSolr10OrLater()` — parses the major version from the
configured image tag, handles a nil `SolrImage`, and treats unparseable tags
(`latest`, `nightly`, custom) as pre-10 for backwards compatibility.
- A package-level `IsSolr10OrLater(imageTag string)` is also exported for
the few call sites that only have a raw image string.
Areas updated for Solr 10:
| Area | Change |
|---|---|
| `solr.xml` | New `DefaultSolrXMLForSolr10` template — drops
`genericCoreNodeNames`, `hostContext`, `allowPaths`, `metricsEnabled`, switches
`host` element to `${solr.host.advertise:}` |
| Host advertise | Sets `SOLR_HOST_ADVERTISE` env var (replaces the
deprecated `host` sysprop) |
| Modules | Sets `SOLR_MODULES` env var; skips
`/opt/solr/contrib/<module>/lib` and `/opt/solr/dist` paths in `sharedLib`
(these directories no longer exist in 10) |
| `hostPort` sysprop | Skipped on Solr 10 (no longer required) |
| TLS cluster prop | `setUrlSchemeClusterPropCmd` uses `solr zk cp` instead
of the removed `cloud-scripts/zkcli.sh` |
| Secure probes | `useSecureProbe` uses `solr api --solr-url …` instead of
the removed `-get` flag |
| E2E helpers | `callSolrApiInPod` uses `--solr-url` and the native
`--credentials user:pass` flag (Solr 10 no longer honors `-Dbasicauth=…` via
`JAVA_TOOL_OPTIONS`) |
## Test plan
- [x] Unit tests for the version parser (`SolrMajorVersion`,
`IsSolr10OrLater` — including unparseable / nil-image cases)
- [x] Unit tests for both `solr.xml` templates (Solr 9 and Solr 10)
- [x] Unit tests for both branches of `useSecureProbe`
- [x] E2E against Solr 10.0.0:
- [x] Basic
- [x] Scale Down / Scale Up with replica migration
- [x] Security JSON — Provided + Bootstrapped
- [x] TLS — Secrets (No Client TLS, Client TLS, ClientAuth Need/Want,
CheckPeerName, VerifyClientHostname)
- [x] TLS — Mounted Dir (ClientAuth Want)
- [x] Backups — Local Directory (Recurring + Single)
- [x] Ingress (addressability change)
- [x] Rolling Upgrades (Managed Update)
- [ ] Prometheus Exporter — fails as expected, exporter removed in Solr 10
(#820)
- [x] E2E regression baseline against Solr 9.8.0 — Basic suite passes
## Notes
- Marked draft — happy to split into smaller commits, rework the API
surface, or scope down based on review feedback.
- One open cosmetic item: Solr 10 logs a `\"deprecated system property
host\"` warning at startup. After investigation this appears to be a Solr-side
false positive (`bin/solr` in 10 doesn't translate `SOLR_HOST` to `-Dhost`, and
Solr 10's own default `solr.xml` ships with the same `<str
name=\"host\">${solr.host.advertise:}</str>` element). Removing `SOLR_HOST`
from the pod spec doesn't silence it. Left as-is; happy to file upstream in
Solr if that's preferred.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]