shaynhornik opened a new pull request, #911: URL: https://github.com/apache/solr-operator/pull/911
## Summary Fixes #701. Adds an optional `automountServiceAccountToken` to the pod options of `SolrCloud` (`customSolrKubeOptions.podOptions`) and `SolrPrometheusExporter` (`customKubeOptions.podOptions`). It is passed to the pod spec of the StatefulSet and the Deployment, so the Service Account token can be kept out of the pods, which is what the AKS / Azure Defender finding in the issue asks for. - **Unset (the default):** the field is left out of the pod spec, as today. Kubernetes does not default it on pod templates, so there is no update loop. - **Set:** `CopyPodTemplates` copies it, so setting, changing or removing it reaches an existing StatefulSet or Deployment. - **Does anything need the token?** I checked the Solr container, the `setup-zk` and TLS init containers, the backup code and the exporter, and found nothing that uses the Kubernetes API or the mounted token. The field comment and docs only warn about the user's own sidecar and init containers. - **Zookeeper pods are not covered.** The issue asks for them too, but `PodPolicy` in zookeeper-operator v0.2.15 has no such option. The docs say so and point to the Service Account setting instead. Also included: regenerated CRDs and deepcopy, a "Service Account Token" section in `custom-kube-options.adoc`, the `solr` Helm chart (`podOptions.automountServiceAccountToken`, rendered for `false` as well as `true`, README row) and changelog entries in both charts. ## Test plan - Controller tests (envtest): the field is absent by default and `false` when set, on the SolrCloud StatefulSet and the exporter Deployment; a new context sets and then removes it on an existing StatefulSet. With the `controllers/util` changes reverted, 3 specs fail. - `go test ./controllers -v`: 88 of 88 specs pass. `go test ./api/... ./controllers/util/...` passes. - `make manifests generate`, `check-format`, `check-manifests`, `check-generated`, `vet`, `check-docs` and `./hack/check_license.sh` pass. - `helm lint` and `helm template` on `helm/solr`: unset renders nothing; `false` and `true` render. `ah lint` passes. - Not run: the e2e/kind tests. Generated-by: Claude Code (Claude Fable 5.2). I reviewed and tested the change. 🤖 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]
