otterc opened a new pull request, #58190: URL: https://github.com/apache/spark/pull/58190
### What changes were proposed in this pull request? `BasicDriverFeatureStep` sets the driver container's `SPARK_USER` env var to `Utils.getCurrentUserName()`, which returns the submitter identity. When a job is submitted with `--proxy-user alice`, `SPARK_USER` in the driver pod is still the submitter (e.g. `spark`), not `alice`. This PR prefers `conf.proxyUser` over `Utils.getCurrentUserName()` when setting `ENV_SPARK_USER` on the driver container. ### Why are the changes needed? Anything in the driver JVM that reads `SPARK_USER` sees the wrong identity today. That includes `SparkContext.sparkUser` (event log ownership, UI attribution) and Spark UI view/modify ACLs (`SecurityManager`). External authz systems (Ranger, custom gRPC interceptors) that resolve identity through SPARK_USER inherit the same wrong value. ### Does this PR introduce _any_ user-facing change? Yes. On Kubernetes cluster mode, SPARK_USER in the driver container now reflects --proxy-user when set. Submissions without --proxy-user are **unchanged**. ### How was this patch tested? Added a unit test ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.7) -- 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]
