Skip to content

fix(controller): resolve {{SPARK_VERSION}} in images with the appliction's Spark version - #3292

Merged
google-oss-prow[bot] merged 1 commit into
kubeflow:masterfrom
vara-bonthu:fix/spark-version-image-substitution
Nov 9, 2026
Merged

google-oss-prow[bot] merged 1 commit into
kubeflow:masterfrom
vara-bonthu:fix/spark-version-image-substitution

Conversation

@vara-bonthu

Copy link
Copy Markdown
Contributor

Problem it fixes: since Spark 4.2, Spark replaces {{SPARK_VERSION}} in image names with the version of whichever Spark does the submitting.

In REST mode that is the submitter (4.0.1), which produced an invalid image name and an app stuck in SUBMITTED.
In spark-submit mode it is the operator’s own Spark, so the app silently ran 4.2.1 instead of 4.3.0.

Effect of the fix: the operator fills in the app’s own spec.sparkVersion first, so one image template works for every Spark version. The placeholder is also documented now.

Breaking: no. If sparkVersion is empty, nothing changes. The only change in behavior is for someone who relied on the placeholder meaning the operator’s Spark version. That is unlikely and was never documented.

…tion's Spark version

Spark replaces {{SPARK_VERSION}} in container image properties with the
version of the Spark that builds the driver pod. That is the operator
image's Spark for spark-submit and the submitter's Spark for the
RestSubmitter, not the version the application declares.

On a v2.6.0-rc.0 cluster an application with sparkVersion 4.3.0 and
image apache/spark:{{SPARK_VERSION}} ran apache/spark:4.2.1 through
spark-submit, and failed with InvalidImageName through the RestSubmitter
(built on Spark 4.0.1, which does not substitute the placeholder).

Substitute the placeholder with .spec.sparkVersion in .spec.image,
.spec.driver.image, .spec.executor.image and spark.kubernetes.*container.image
entries in .spec.sparkConf before building the submit arguments, matching
apache/spark-kubernetes-operator. An empty sparkVersion keeps the
placeholder for Spark to resolve.

Signed-off-by: vara-bonthu <vara.bonthu@gmail.com>
@tariq-hasan

Copy link
Copy Markdown
Member

/lgtm

@nabuskey nabuskey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nabuskey

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit dc0e064 into kubeflow:master Nov 9, 2026
24 checks passed
@tariq-hasan

Copy link
Copy Markdown
Member

/cherry-pick release-2.6

@google-oss-robot

Copy link
Copy Markdown

@tariq-hasan: new pull request created: #3300

Details

In response to this:

/cherry-pick release-2.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

shruthis4 pushed a commit to opendatahub-io/spark-operator that referenced this pull request Nov 16, 2026
* fix: preserve shell-sensitive Spark Connect configuration values (#3051)

* fix: preserve shell-sensitive Spark Connect configuration values

Signed-off-by: Jay Bharadwaj <jbharadw@openai.com>

* refactor: improve Spark Connect shell quoting readability

Signed-off-by: Jay Bharadwaj <jbharadw@openai.com>

---------

Signed-off-by: Jay Bharadwaj <jbharadw@openai.com>

* Chore(Remove go card from readme) - #3058 (#3060)

Signed-off-by: Tamir Krasna <64045253+Tankdoggo@users.noreply.github.com>

* chore(deps): bump github.com/prometheus/common from 0.67.5 to 0.70.1 in /test/e2e (#3083)

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.67.5 to 0.70.1.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/common/compare/v0.67.5...v0.70.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-version: 0.70.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump actions/checkout from 6.0.2 to 7.0.1 (#3086)

Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 7.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v6.0.2...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(ci): Publish Spark Operator binaries with GitHub releases (#3078)

* initial commit

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* feat(ci): publish operator binaries with GitHub releases

Cross-build spark-operator for linux/amd64 and linux/arm64 in the
draft_release job, package with checksums, and attach to the release.

Closes #3073

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fixing typo as part of my previous PR https://github.com/kubeflow/spark-operator/pull/3056

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* Update .github/workflows/release.yaml

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Vikas Saxena <90456542+vikas-saxena02@users.noreply.github.com>

* fix(ci): stage release binaries outside the repo and harden verification

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(ci): entrypoint was not part of tar ball so adding it

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(build): read VERSION from file so an inherited env var cannot double the v prefix

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <90456542+vikas-saxena02@users.noreply.github.com>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>

* feat: garbage-collect terminated SparkApplications via operator default TTL (#3042)

* feat: add DefaultTimeToLive alpha feature gate

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* feat: add EffectiveTimeToLiveSeconds TTL resolution helper

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* feat: add --default-time-to-live-seconds controller flag

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* feat: apply operator default TTL when reconciling terminated SparkApplications

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* feat: expose default TTL via Helm chart

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* refactor: unify TTL expiry logic and harden default-TTL edges

Address code review feedback on the operator default-TTL feature:

- Unify expiry into util.IsExpiredWithTTL, the single primitive that takes
  an explicit (possibly defaulted) TTL; IsExpired delegates to it. Treat a
  non-positive spec.timeToLiveSeconds as 'expire immediately' everywhere, so
  an explicit user value always wins over the operator default and behavior
  is unchanged from before this feature.
- Move the expiry decision out of the controller into util; the reconciler
  now calls util.IsExpiredWithTTL with the effective TTL.
- Fix a flaky controller test: drive the app into COMPLETED with a past
  TerminationTime unconditionally (get-or-create) so the precondition holds
  even when the object already exists.
- Render --default-time-to-live-seconds only when the value is > 0 so a
  negative value no longer emits the flag; add a chart test for it.

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* feat: make DefaultTimeToLive gate authoritative and consistent

Address further review feedback on the operator default-TTL feature:

- Gate the Helm-rendered --default-time-to-live-seconds flag on both the
  DefaultTimeToLive feature gate (new spark-operator.defaultTimeToLive.enabled
  helper, mirroring the RestSubmitter one) and a positive value, so the chart
  no longer emits a flag the controller would ignore at runtime.
- Validate the flag at controller startup: error in PreRunE when the gate is
  enabled but the value is non-positive, and warn (after the logger is set up)
  when the value is set but the gate is disabled.
- Log the operator-default provenance only when the app is actually deleted,
  instead of on every reconcile of a terminated app.
- Make the event filter's resync guard use the effective TTL so an app expired
  via the operator default is re-admitted for deletion, consistent with the
  controller's cleanup decision; thread defaultTimeToLiveSeconds through the
  event filter and add coverage.

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* chore: add DefaultTimeToLive feature gate to manager manifest

The generated controller manifest enumerates all feature gates in its
--feature-gates arg. Add DefaultTimeToLive=false so the manifest matches
the registered gates and the drift check passes.

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* fix: reject only negative default TTL and cover the not-yet-expired requeue path

Refine the --default-time-to-live-seconds validation and add missing test
coverage for the operator default TTL:

- Scope the PreRunE guard to negative values only. A negative TTL is never
  meaningful and is now rejected regardless of the feature gate, while 0
  remains the valid 'off' sentinel (even when the gate is enabled) rather
  than a hard startup error. Update the flag help to match.
- Add a controller test for a terminated app that has not yet outlived the
  operator default TTL (terminated 30s ago, default 60s): assert it is not
  deleted and is requeued via RequeueAfter computed from the effective TTL.

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* feat: render a zero default TTL as a valid Helm flag and cover it

Make defaultTimeToLiveSeconds=0 a valid, explicitly-rendered value rather
than a silently-omitted one:

- Change the deployment template guard from 'gt ... 0' to 'ge ... 0' so a
  zero value renders --default-time-to-live-seconds=0 when the gate is
  enabled. Negative values are still omitted to avoid the binary's startup
  rejection. Update the chart test for the zero case accordingly.
- Add a controller test proving that with the gate enabled and a zero
  default TTL, a terminated SparkApplication is neither deleted nor
  requeued (the zero value disables the default, as intended).

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* refactor: normalize default TTL configuration

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

---------

Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>

* chore(deps): bump github.com/onsi/ginkgo/v2 from 2.27.2 to 2.32.1 in /test/e2e (#3095)

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.27.2 to 2.32.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.27.2...v2.32.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-version: 2.32.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: document webhook failure when a service mesh sidecar is injected (#3100)

* docs: document webhook failure when a service mesh sidecar is injected

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* adding caveat for multiple releases

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(webhook): generate valid volume names for ConfigMaps (#3099)

Signed-off-by: immanuwell <pchpr.00@list.ru>

* feat(ci): publish the operator binary extracted from the released image (#3098)

* feat(ci): publish the operator binary extracted from the released image

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* incoperating review comments by Tariq

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* incoperating review comments by Tariq - take 2

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(sparkconnect): resolve images from selected template containers (#3103)

Signed-off-by: immanuwell <pchpr.00@list.ru>

* docs: add Spark Connect user guide (#3091)

Signed-off-by: Vidyansh <ezboi2312@gmail.com>

* feat(controller): add default service account fallback for SparkApplication driver (#3092)

* feat(controller): add default service account fallback for SparkApplication driver

Adds a --default-service-account controller flag. When set, SparkApplications
that do not specify .spec.driver.serviceAccount fall back to this value at
submission time. The fallback is applied to a copy of the application so it is
never persisted to the custom resource.

Empty by default, so behaviour is unchanged on upgrade.

Part of #3049

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* refactor(controller): move driver service account fallback to pkg/util and honour pod template

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* feat(controller): validate --default-service-account is a valid DNS subdomain

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* chore(chart): group --default-service-account with other controller defaults

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* docs: document the default driver service account flag

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(webhook): generate valid volume name for Prometheus ConfigMap (#3111)

A SparkApplication name may be up to 63 characters, so appending the
Prometheus ConfigMap and volume suffixes overshoots the volume name limit
and Kubernetes rejects every driver and executor pod of the application.

Signed-off-by: rjgoyln <pt40419@gmail.com>

* refactor: centralize Spark container selection (#3115)

* refactor: centralize Spark container selection

Signed-off-by: rohith1X8 <rohith18p18@gmail.com>

* chore: address review comments

Signed-off-by: rohith1X8 <rohith18p18@gmail.com>

---------

Signed-off-by: rohith1X8 <rohith18p18@gmail.com>

* feat(sparkconnect): add service account fallback for Spark Connect server pod (#3109)

* feat(sparkconnect): add service account fallback for Spark Connect server pod

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* refactor(sparkconnect): drop server serviceAccount CRD field as asked by Tariq and clarify flag scope

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* refactor(sparkconnect): inline default service account fallback and add log line

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* chore(ci): migrate vulnerability scanning to OSV-Scanner (#3110)

* chore(ci): migrate vulnerability scanning to OSV-Scanner

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* Update .github/workflows/osv-scanner.yaml

Co-authored-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
Signed-off-by: Vikas Saxena <90456542+vikas-saxena02@users.noreply.github.com>

* chore(ci): remove image scanning job as instructed by @nabuskey

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <90456542+vikas-saxena02@users.noreply.github.com>
Co-authored-by: Manabu McCloskey <manabu.mccloskey@gmail.com>

* chore(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 in /test/e2e (#3136)

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.82.1 to 1.83.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.82.1...v1.83.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.83.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump tornado from 6.5.7 to 6.5.8 in /docs/website (#3135)

Bumps [tornado](https://github.com/tornadoweb/tornado) from 6.5.7 to 6.5.8.
- [Changelog](https://github.com/tornadoweb/tornado/blob/master/docs/releases.rst)
- [Commits](https://github.com/tornadoweb/tornado/compare/v6.5.7...v6.5.8)

---
updated-dependencies:
- dependency-name: tornado
  dependency-version: 6.5.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Make webhook leader election timings configurable (#3065)

* feat(webhook): add leader election parameters for lease duration, renew deadline, and retry period

Signed-off-by: mosa0519 <mohanakrishna.sadhu@netcracker.com>

* feat(webhook): add leader election parameters for lease duration and renew deadline

Signed-off-by: mosa0519 <mohanakrishna.sadhu@netcracker.com>

* feat(webhook): update leader election renew deadline and retry period durations

Signed-off-by: mosa0519 <mohanakrishna.sadhu@netcracker.com>

---------

Signed-off-by: mosa0519 <mohanakrishna.sadhu@netcracker.com>

* fix(webhook): validate ConfigMap references in SparkApplication specs (#3117)

* fix(webhook): validate ConfigMap references in SparkApplication specs

An unusable or repeated ConfigMap reference is accepted today and only surfaces
in the pod the mutating webhook builds, which the API server then rejects over a
name the user never chose while the application itself looks healthy.
ScheduledSparkApplication carries the same spec, so it needs the same check.

Signed-off-by: rjgoyln <pt40419@gmail.com>

* fix(webhook): point ConfigMap validation errors at the name field

Each configMaps entry carries both a name and a mount path, so an error that
stops at the list index leaves the reader guessing which of the two is wrong.

Signed-off-by: rjgoyln <pt40419@gmail.com>

---------

Signed-off-by: rjgoyln <pt40419@gmail.com>

* docs: replace Enterprise Gateway notebooks guide with Kubeflow SDK (#3141)

* docs: replace Enterprise Gateway notebooks guide with Kubeflow SDK

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* docs: correct Kubeflow SDK install to kubeflow[spark]

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fixing unpushed commit

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* chore: untrack Python bytecode and ignore __pycache__

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* docs: add SparkConnect API reference to api-docs.md (#3126)

* docs: generate api reference for SparkConnect (v1alpha1)

Add api/doc.go with 'package api' so gen-crd-api-reference-docs can
parse the parent api directory. Update Makefile build-api-docs target
to point at the parent api directory to capture both v1beta2 and
v1alpha1 packages.

Fixes #3114

Signed-off-by: Fumer057 <fumer057@users.noreply.github.com>

* chore: trigger CI to resolve network flake

Signed-off-by: Fumer057 <fumer057@users.noreply.github.com>

* docs: address reviewer comments for SparkConnect API reference

Signed-off-by: Fumer057 <fumer057@users.noreply.github.com>

* docs: fix copyright header in api/doc.go

Signed-off-by: Fumer057 <fumer057@users.noreply.github.com>

---------

Signed-off-by: Fumer057 <fumer057@users.noreply.github.com>
Co-authored-by: Fumer057 <fumer057@users.noreply.github.com>

* fix(webhook): validate ConfigMap mount-path uniqueness (#3140)

* fix(webhook): validate ConfigMap mount-path uniqueness

Motivation:
spec.{driver,executor}.configMaps entries with different names but the
same mount path pass admission today, since the ConfigMap validator only
rejected duplicate names. The mutating webhook then builds one volumeMount
per entry, so two entries sharing a path produce two volumeMounts with an
identical mountPath, which the API server rejects at pod creation with a
generic error that gives no hint the SparkApplication spec is the cause.

Conversely, mounting the same ConfigMap at two different paths was
rejected outright by the duplicate-name check, even though that is a
legitimate configuration: the mutating webhook just needs to build one
pod volume per distinct ConfigMap and one volumeMount per entry, instead
of one volume per entry.

Approach:
- internal/webhook/configmap_validator.go: validateConfigMapList now
  rejects entries whose mount Path repeats within the same driver or
  executor configMaps list, instead of rejecting a repeated Name.
- internal/webhook/sparkpod_defaulter.go: addGeneralConfigMaps now adds
  each derived ConfigMap volume at most once, while still emitting a
  volumeMount for every entry, so the same ConfigMap can be mounted at
  multiple paths without the pod ending up with two volumes sharing a
  name.

Validation:
- go test ./internal/webhook/... (including the ginkgo envtest suite,
  run with KUBEBUILDER_ASSETS pointed at the make setup-envtest binaries)
  passes, including new/updated cases: a duplicate mount path is now
  rejected, the same ConfigMap at two distinct paths is now accepted and
  produces one volume with two volumeMounts, and a previously-invalid
  "duplicate ConfigMap name" spec is now valid as long as paths differ.
- go test $(go list ./... | grep -v -e /drift -e /test/e2e) passes.
- make go-vet, make go-fmt (no diff), and make go-lint (0 issues) all
  pass clean; go mod tidy produced no changes.
- Branch is at upstream/master tip (ff244c1); upstream's own Integration
  Test workflow is green on recent master runs.

Report: https://github.com/kubeflow/spark-operator/issues/3134
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5 (via Claude Code)

* fix(webhook): key ConfigMap volume dedup by source name, not generated volume name

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>

* fix(webhook): reject empty and reserved ConfigMap mount paths

validateConfigMapList now rejects an empty configMaps[].path (which
otherwise builds an invalid VolumeMount) and a path that collides with
one the webhook reserves for the Spark, Hadoop, or Prometheus
ConfigMap it mounts itself, mirroring the same gating logic
addPrometheusConfig uses to decide whether that mount happens.

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>

---------

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Co-authored-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>

* docs: add SparkConnect to the website API reference (#3138)

* docs: add SparkConnect to the website API reference

The reference section documented only the two v1beta2 kinds, so SparkConnect
(sparkoperator.k8s.io/v1alpha1) was missing from both the landing page card and
the API reference page.

make build-api-docs generates from api/v1beta2 only, so there is no generated
reference to link for SparkConnect. The page points at the Go types and the
Spark Connect user guide instead.

Signed-off-by: Shivansh Pandey <shivanshp987@gmail.com>

* docs: address review on the SparkConnect API reference

- Drop the version claim from the generated-reference link and the regeneration
  note. #3126 extends build-api-docs to the parent api directory, so wording that
  named v1beta2 would be wrong once it lands; this phrasing holds either way.
- Remove the per-CRD facts table. It covered SparkConnect only, and hand-copying
  group, kind, resource and scope for all three would duplicate what
  docs/api-docs.md generates.
- Update the Reference card on the landing page (docs/website/index.rst) to name
  all three custom resources.

Signed-off-by: Shivansh Pandey <shivanshp987@gmail.com>

---------

Signed-off-by: Shivansh Pandey <shivanshp987@gmail.com>

* fix: stop adding SparkApplication owner reference to executor pods (#3152)

* Stop adding SparkApplication owner reference to executor pods

Since #2670 executor pods carried two owners: the driver pod
(controller=true, set by Spark) and the SparkApplication
(non-controller, added at submission time). Kubernetes garbage
collection only deletes a dependent once all owners are gone, so
deleting the driver pod (manual delete, spec.suspend=true, Kueue
preemption) left executor pods orphaned until the SparkApplication
itself was deleted.

Drop the extra owner reference so executors are cascade-deleted with
the driver pod. Deleting the SparkApplication still cascades through
the driver pod to the executors.

Issue: https://github.com/kubeflow/spark-operator/issues/2961
Signed-off-by: KR Ravindra <42912207+KR-Ravindra@users.noreply.github.com>

* Assert executor pods are deleted when a SparkApplication is suspended

Extend the spark-pi suspend/resume e2e test: wait for an executor pod to
exist before suspending, then after the application reaches Suspended
assert that no driver or executor pods labelled with the application
name remain. With the extra SparkApplication owner reference on
executors this assertion fails because the executor pods survive the
driver pod deletion.

Signed-off-by: KR Ravindra <42912207+KR-Ravindra@users.noreply.github.com>

---------

Signed-off-by: KR Ravindra <42912207+KR-Ravindra@users.noreply.github.com>

* test(util): add unit tests for CreateValidMetricNameLabel (#3159)

* Add unit tests for CreateValidMetricNameLabel

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>

* test(util): expand CreateValidMetricNameLabel cases via DescribeTable

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>

---------

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>

* chore: remove unused pkg/util/interrupt.go (#3162)

Motivation:
InterruptHandler in pkg/util/interrupt.go had no callers anywhere in
the repository. It was added to support sparkctl, but sparkctl was
removed without cleaning up this now-dead file.

Approach:
Delete pkg/util/interrupt.go outright. Confirmed via repo-wide search
that InterruptHandler/NewInterruptHandler are referenced nowhere else
(no other Go file, test, YAML, or doc).

Validation:
- go build ./...: succeeds
- go test ./pkg/util/...: 121 specs pass, 0 failures
- make unit-test (full repo suite): all packages pass
- make go-fmt / make go-vet: no diff
- make go-lint (golangci-lint, whole repo): 0 issues
- make build-operator: succeeds
- go mod tidy: no diff
- Branch HEAD matches upstream/master tip; upstream master CI is green

Report: https://github.com/kubeflow/spark-operator/issues/3161

Assisted-by: claude-sonnet-5 (via Claude Code)

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Co-authored-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>

* feat(sparkconnect): support GPU resources in SparkConnect CRD (#3169)

* feat(api): add GPU support to SparkConnect

Signed-off-by: Rajadi16 <rajputadityasingh2407@gmail.com>

* chore: sync helm chart CRD with GPU field

Signed-off-by: Rajadi16 <rajputadityasingh2407@gmail.com>

* fix(sparkconnect): address GPU API review feedback

- Regenerate swagger.json and Python API models (models/__init__.py,
  spark_v1alpha1_{executor,server,spark_pod}_spec.py,
  spark_v1alpha1_gpu_spec.py) to include v1alpha1 GPUSpec schema and
  optional gpu fields on SparkPodSpec, ServerSpec, and ExecutorSpec.
  SparkV1alpha1GPUSpec is now exported from models/__init__.py.

- Add Python regression tests (api/python_api/tests/test_gpu_spec.py)
  covering GPU round-trips, CPU-only behavior, and the complete
  SparkConnect specification. Tests live outside the generator's
  git-clean paths and are not affected by make generate.

- Document GPUSpec name validation: gpuConfOption splits on '/' to
  derive the Spark GPU vendor, validates the suffix is 'gpu' and the
  vendor is a valid DNS-1123 subdomain, and returns an error on invalid
  input. Both constraints are enforced at admission via kubebuilder
  markers. v1beta2.GPUSpec is intentionally left unchanged.

- Add note to spark-connect.md explaining that .spec.server.gpu is
  applied only during server-pod creation; editing the field does not
  update a running pod, and recreation interrupts active sessions.

- Fix misleading test comment: typed GPU settings override the same
  keys in sparkConf (amount and vendor); unrelated keys pass through.

Signed-off-by: Rajput Aditya Singh <rajputadityasingh2407@gmail.com>

* fix(sparkconnect): address GPU review feedback

- Remove hand-written tests from generated python_api
- Move SetGPUResources to pkg/util and drop executor template mutation
- Move gpuConfOption into options.go
- Reword GPUSpec godoc as durable API documentation
- Validate GPU discovery configuration in the SparkConnect webhook

Signed-off-by: Rajadi16 <rajputadityasingh2407@gmail.com>

---------

Signed-off-by: Rajadi16 <rajputadityasingh2407@gmail.com>
Signed-off-by: Rajput Aditya Singh <rajputadityasingh2407@gmail.com>

* fix(sparkconnect): pass server options as individual container arguments (#3188)

* wip: options.go - drop shell quoting, move script path out of args

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* wip: reconciler.go - invoke server script via fixed entrypoint prelude

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* wip: options_test.go - assert args without shell round-trip

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* test(sparkconnect): assert entrypoint shape and per-argument options

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* test(sparkconnect): verify the entrypoint against a stub server script

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* docs(sparkconnect): document Kubernetes variable expansion in configuration values

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(controller): always clean up pod template files (#3178)

Signed-off-by: Aakcht <aakcht@gmail.com>

* fix(sparkconnect): update GPU specs for per-argument container args (#3212)

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* test(util): add unit tests for InitializeIngressCapabilities (#3156)

* Add unit tests for InitializeIngressCapabilities

getPreferredAvailableAPIs and InitializeIngressCapabilities had no
test file at all. The real client-go fake discovery client always
stubs ServerPreferredResources to nil, so this adds a small local
discovery double instead, covering a match, no match, the second
call being a no-op, and both the orphaned-API-service and generic
error paths.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>

* Address review feedback on capabilities tests

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>

---------

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>

* fix: default the retry interval when the webhook has not set it (#3209)

The 5s default for onFailureRetryInterval and
onSubmissionFailureRetryInterval is only applied by the mutating
webhook. With the webhook disabled, a SparkApplication with restartPolicy
Always or OnFailure and no interval made TimeUntilNextRetryDue return an
error, so the application stayed in Failing or FailedSubmission and was
requeued forever instead of being retried.

Add a DefaultRestartPolicyRetryIntervalSeconds constant, use it in the
defaulter, and fall back to it in TimeUntilNextRetryDue when the
interval is nil. Add unit tests for TimeUntilNextRetryDue.

Issue: https://github.com/kubeflow/spark-operator/issues/3208

Signed-off-by: pratik naik <naikp0241@gmail.com>

* test: add unit tests for SumResourceList (#3200)

* test(util): add unit tests for SumResourceList

Add table-driven Ginkgo tests for SumResourceList covering nil and
empty input, a single list, summing the same resource across lists
(including mixed units), merging distinct resources, and ensuring the
input lists are not mutated.

Issue: https://github.com/kubeflow/spark-operator/issues/3199
Signed-off-by: pratik naik <naikp0241@gmail.com>

* test(util): use decimal-backed quantities in SumResourceList mutation test

int64-backed quantities are independent after a plain struct copy, so
the mutation test passed even without DeepCopy in SumResourceList.
Build the inputs from inf.Dec-backed quantities, which share the
underlying *inf.Dec when copied, so the test fails if DeepCopy is
removed.

Promote gopkg.in/inf.v0 to a direct dependency.

Signed-off-by: pratik naik <naikp0241@gmail.com>

---------

Signed-off-by: pratik naik <naikp0241@gmail.com>

* docs: clarify inherited dependency security boundary (#3214)

Signed-off-by: Shitanshu Pandey <shitanshu.19p@gmail.com>

* chore(deps): bump urllib3 from 2.7.0 to 2.8.0 in /docs/website (#3220)

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.7.0...2.8.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.8.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump tornado from 6.5.8 to 6.5.9 in /docs/website (#3219)

Bumps [tornado](https://github.com/tornadoweb/tornado) from 6.5.8 to 6.5.9.
- [Changelog](https://github.com/tornadoweb/tornado/blob/master/docs/releases.rst)
- [Commits](https://github.com/tornadoweb/tornado/compare/v6.5.8...v6.5.9)

---
updated-dependencies:
- dependency-name: tornado
  dependency-version: 6.5.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: name the actual flag in TLS setup errors (#3204)

SetupTLS reported invalid values as "--tls-min-version" and
"--tls-cipher-suites", but those flags do not exist. The real flags are
--webhook-tls-* on the webhook and --metric-tls-* on the controller.

Pass the flag prefix into SetupTLS so its errors name the flag the user
actually set, and add unit tests for SetupTLS, ParseTLSVersion and
ParseCipherSuites (pkg/tls previously had no tests).

Issue: https://github.com/kubeflow/spark-operator/issues/3203

Signed-off-by: pratik naik <naikp0241@gmail.com>

* fix(scheduledsparkapplication): recover from FailedValidation state when spec is corrected (#3175)

Signed-off-by: Aditya Raut <rautaditya2606@gmail.com>

* docs: add REST submitter integration guide (#3216)

Signed-off-by: Venkateswarlu Komirisetti <venkomirisetti@gmail.com>

* feat: add support for managedBy field on SparkApplication (#3221)

* feat: add support for managedBy field on SparkApplication

Signed-off-by: amirialy <amiribrahim646@gmail.com>

* docs: document SparkApplication managedBy

Signed-off-by: amirialy <amiribrahim646@gmail.com>

* add CEL validation on managedby field and regenrate

Signed-off-by: amirialy <amiribrahim646@gmail.com>

* sync generated CRDs

Signed-off-by: amirialy <amiribrahim646@gmail.com>

* fix e2e test

Signed-off-by: amirialy <amiribrahim646@gmail.com>

* add CEL back to sparkapplication spec

Signed-off-by: amirialy <amiribrahim646@gmail.com>

---------

Signed-off-by: amirialy <amiribrahim646@gmail.com>

* test: add unit tests for LogConstructor (#3181)

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>

* docs: add AGENTS.md and CLAUDE.md for AI coding agents (#3192)

* docs: add AGENTS.md and CLAUDE.md for AI coding agents

Signed-off-by: Abhayanth K <abhayanth2006@gmail.com>

* docs: address review feedback on AGENTS.md

Signed-off-by: Abhayanth K <abhayanth2006@gmail.com>

* docs: clarify pkg/client regeneration in AGENTS.md

Signed-off-by: Abhayanth K <abhayanth2006@gmail.com>

* docs: address second review round on AGENTS.md

Signed-off-by: Abhayanth K <abhayanth2006@gmail.com>

* docs: note uv requirement for docs targets in AGENTS.md

Signed-off-by: Abhayanth K <abhayanth2006@gmail.com>

---------

Signed-off-by: Abhayanth K <abhayanth2006@gmail.com>

* feat!: Add webhook namespace-selector for multi-tenant deployments (#3217)

* feat!: add webhook namespace-selector for multi-tenant deployments

Closes #2913. Webhook now uses the same namespace matcher as the
controller. jobNamespaceSelector must be an object; the string form
is removed. Dual registration covers jobNamespaces OR labels.

BREAKING CHANGE: spark.jobNamespaceSelector no longer accepts a string.

Co-authored-by: Antonios Kouzoupis <kouzoupis.ant@gmail.com>
Signed-off-by: roburishabh <roburishabh@outlook.com>

* fix: address review on webhook namespace-selector

- Version the string-form removal as v2.6.0 (string form shipped in
  v2.5.0; latest release is v2.5.2) across values, templates, tests
  and README.
- Stringify matchLabels/matchExpressions values so non-string YAML
  (e.g. spark: true) renders as "true" instead of being rejected by
  the API server; null values now fail with a clear message.
- Use the Kubeflow boilerplate license header in the new webhook files.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: roburishabh <roburishabh@outlook.com>

* refactor: centralize jobNamespaceSelector validation in one helper

Move operator, null-value, and type checks from namespaceSelectorFlag
and structuredJobNamespaceSelector into validateNamespaceConfig.
Rendering helpers now assume valid input.

Signed-off-by: roburishabh <roburishabh@outlook.com>

---------

Signed-off-by: roburishabh <roburishabh@outlook.com>
Co-authored-by: Antonios Kouzoupis <kouzoupis.ant@gmail.com>
Co-authored-by: Claude Code <noreply@anthropic.com>

* docs: add 2026 roadmap (#3179)

Signed-off-by: tariq-hasan <mmtariquehsn@gmail.com>

* feat(controller): allow Spark 4.2 NetworkPolicy creation (#3240)

Signed-off-by: Shitanshu Pandey <shitanshu.19p@gmail.com>

* test(e2e): run SparkConnect query on the Connect server, not a local … (#3239)

* test(e2e): run SparkConnect query on the Connect server, not a local Classic session

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* test(e2e): set TERM for the Spark Connect REPL under kubectl exec

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(controller): authorize events.k8s.io for SparkApplication events (#3227)

Signed-off-by: roburishabh <roburishabh@outlook.com>

* Adding Vikas and Vincent to reviewers (#3246)

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(controller): mark missing executors completed when the driver succeeds (#3244)

updateDriverState moves a successful app to SUCCEEDING, not COMPLETED, so
updateExecutorState never took its "assume completed" branch on that pass
and marked executors whose pods were already gone as FAILED. FAILED is
terminal, so the later COMPLETED pass kept it. Treat SUCCEEDING the same
as COMPLETED.


Assisted-by: Claude

Signed-off-by: Rishabh <rishabhsaiv@gmail.com>

* Add comment policy to AGENTS.md (#3247)

Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>

* feat: support physical CPU request and limit in SparkConnect CRD (#3096)

* feat: support CPU requests and limits for SparkConnect

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore: regenerate SparkConnect Python API

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* docs: update SparkConnect CPU example

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* fix: apply SparkConnect server CPU resources directly

Apply server.coreRequest and server.coreLimit directly to the Kubernetes CPU resources of the operator-created SparkConnect server pod.

Remove the incorrect driver Spark configuration mappings while keeping executor CPU configuration through spark.kubernetes.executor.{request,limit}.cores.

Add reconciler tests covering CPU resources and template behavior.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* fix: address SparkConnect CPU resource review feedback

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* fix: resolve CI manifest and e2e test failures

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore: regenerate SparkConnect API artifacts

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Refactor SparkConnect CPU resource handling and validation

- Use resource.Quantity directly for SparkConnect CPU resources.
- Update CPU validation and controller logic for resource.Quantity.
- Update documentation for CPU resource specifications and pod lifecycle behavior.
- Update unit and e2e tests for the new CPU resource handling.
- Regenerate API artifacts and CRDs.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore: regenerate api-docs and Python models for SparkConnect CPU fields

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore: remove internal review-tracking comments

Drop 8 lines of comments that named a reviewer or restated the spec to prove a reviewer point. These belong in the PR conversation, not in production test code. Behavior is unchanged.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* test(e2e): wait for server pod creation, not readiness, in CPU-resource specs

The SparkConnect CPU Resources e2e specs were waiting for the server pod

to become ready before asserting on its spec. Readiness requires the Spark

image to be pulled and the JVM to bind the connect port, which adds ~5 min

per spec (startup probe permits 5+10x30s, on top of image pull and JVM

boot). Two of the three specs were creating the same SparkConnect and

paying that cost separately, contributing to the e2e-test job blowing its

30-minute budget.

All the asserted fields (server CPU request/limit, server pod args,

template precedence, template memory preservation) are written by the

operator synchronously inside CreateOrUpdate, so waiting for the pod

object to exist is sufficient. The live-server path is still covered by

the SparkConnect Query spec.

Replace the readiness waits with a waitForServerPod helper that polls

until k8sClient.Get returns the server pod, and collapse the two

duplicate-setup blocks in the first Context into one. No assertion

changes; coverage is identical.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore(sparkconnect): address review feedback on PR #3096

Three small changes in one commit, all touching the SparkConnect CPU-resource surface:

- api/v1alpha1: shorten CoreRequest and CoreLimit doc comments to a single sentence, matching the surrounding Cores/Memory fields and the v1beta2 sibling style. Regenerate the CRD, the Helm chart copy of the CRD, and the Python API models so they pick up the new description.

- test/e2e: bump SparkVersion from 4.0.0 to 4.0.4 in both SparkConnect CPU-resources BeforeEach blocks; the test image is already 4.0.4 and the canonical example YAML plus Makefile SPARK_IMAGE default are both 4.0.4, so 4.0.0 was a stale fixture leftover.

- test/e2e: add one new It to the Precedence Context that waits for the operator-created server pod to become ready (util.IsPodReady), exercising JVM startup end-to-end. The Apply server CoreRequest Context still waits only for pod creation, since its assertions are on fields the operator writes at creation time.

Files touched by hand:
  api/v1alpha1/sparkconnect_types.go
  test/e2e/sparkconnect_resources_test.go

Files regenerated:
  api/openapi-spec/swagger.json
  api/v1alpha1/zz_generated.openapi.go
  config/crd/bases/sparkoperator.k8s.io_sparkconnects.yaml
  charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkconnects.yaml
  api/python_api/kubeflow_spark_api/models/spark_v1alpha1_spark_pod_spec.py
  api/python_api/kubeflow_spark_api/models/spark_v1alpha1_server_spec.py
  api/python_api/kubeflow_spark_api/models/spark_v1alpha1_executor_spec.py

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore(docs): regenerate api-docs.md after doc-comment change

The CoreRequest/CoreLimit doc comment in api/v1alpha1/sparkconnect_types.go was shortened to one line in 7dee9a6, but the regenerated docs/api-docs.md was not committed. The build-api-docs CI step (integration.yaml:81) runs "make build-api-docs" then fails with "Need to re-run make build-api-docs and commit the changes." when the file is dirty.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore(helm-chart): fix line endings in values.yaml and README.md

Both files were committed with CRLF (Windows) line terminators. The build-helm-chart CI step runs "ct lint" (integration.yaml:184), which executes yamllint on chart YAML files. yamllint default config rejects CRLF (rule: new-lines, expected: \n), causing "failed linting charts: failed processing charts" with exit status 1.

This is pre-existing in the repo (not introduced by the SparkConnect CPU PR); the file was committed as CRLF long before 7dee9a6. README.md was also regenerated by make helm-docs, which writes LF, so the working-tree diff is purely the CRLF->LF conversion on both files (no content changes).

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* test(e2e): use spark-operator-spark SA in SparkConnect CPU resources e2e

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* docs: update SparkConnect guide to streamline content and add checking instructions

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update api/v1alpha1/sparkconnect_types.go

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update api/v1alpha1/sparkconnect_types.go

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore: restore LF line endings in files unintentionally rewritten as CRLF

Commit d606aee (regenerated CRD/Python artifacts) accidentally rewrote 11 unrelated files with CRLF line endings on Windows. The GitHub PR diff showed every line of these files as changed even though their content is identical to master (git diff --ignore-cr-at-eol is empty for all of them).

This restores the 10 pure line-ending-only files from master and converts docs/website/user-guide/index.md to LF, keeping its real changes (the Working with SparkConnect card and toctree entry). Follows the same approach as 0c79581, which fixed values.yaml and README.md the same way; those files dropped out of the PR diff afterwards.

After this commit, git ls-files --eol reports no CRLF blobs in the index.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* chore: regenerate CRD, OpenAPI, and Python artifacts for shortened CoreRequest/CoreLimit comments

The CoreRequest/CoreLimit doc comments in api/v1alpha1/sparkconnect_types.go were shortened (376f6aa, 2edf81d) without regenerating the derived artifacts, leaving them stale and failing the make generate and make build-api-docs CI checks.

Regenerated with 'make generate', 'make update-crd', and 'make build-api-docs':
- config/crd/bases and charts/spark-operator-chart/crds SparkConnect CRD descriptions
- api/openapi-spec/swagger.json and api/v1alpha1/zz_generated.openapi.go
- the three SparkConnect Python models
- docs/api-docs.md field descriptions

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* fix(sparkconnect): validate effective CPU request/limit and drop needless error return

Address two follow-up review comments on PR #3096:

- The coreRequest <= coreLimit validation now runs on the effective values
  rather than requiring both CRD fields to be set. A CRD field always wins;
  a missing CRD field falls back to the pod template container's CPU
  resources (spec.server.template / spec.executor.template), so a
  coreRequest that exceeds only the template's coreLimit is now rejected
  at admission, and a missing side is simply skipped.

- setupServerContainerResources no longer returns an error when it can
  only return nil; the mutateServerPod call site and tests are simplified
  accordingly.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* docs(sparkconnect): document effective CPU request/limit validation and clarify error wording

The CPU request/limit cross-validation now runs on the effective values
(CRD field wins, pod template container resources as fallback) since
b0e872b, but the user guide still described the old both-fields-set
semantics. Update it to state the precedence rule and the skip-when-missing
behavior.

Also prefix the validateCPURequestLELimit error with "effective" since
either value may come from the pod template rather than the CRD spec.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* fix(webhook): align SparkConnect executor CPU validation with Spark

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update test/e2e/sparkconnect_resources_test.go

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update internal/controller/sparkconnect/reconciler.go

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* refactor(sparkconnect): move server CPU resource helper to pkg/util

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* examples(sparkconnect): add custom resource example

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* sparkconnect: update e2e tests and documentation

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* fix(sparkconnect): use the renamed parsedSparkConfig test helper

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* ci: retrigger workflows

The e2e-test (v1.34.3, helm) job failed on a transient proxy.golang.org stream error while building the image (go mod download), and the matrix's default fail-fast then cancelled its seven sibling jobs. No source change is needed, so this commit is intentionally empty: it re-fires the pull_request synchronize event to re-run the workflows.

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update examples/sparkconnect/spark-connect-custom-resource.yaml

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update examples/sparkconnect/spark-connect-custom-resource.yaml

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update test/e2e/sparkconnect_resources_test.go

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update internal/controller/sparkconnect/reconciler.go

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* Update docs/website/user-guide/working-with-sparkconnect.md

Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* docs(sparkconnect): trim explanatory comments per review

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* ci: re-trigger workflow

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

* fix(sparkconnect): improve CPU resource validation and docs

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>

---------

Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
Co-authored-by: Kartik Nath Khatri <kartik.nath.khatri@gmail.com>
Co-authored-by: Kartik Nath Khatri <kartiknathkhatri@users.noreply.github.com>
Co-authored-by: Kartik Nath Khatri <knkhatri@example.invalid>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com>

* feat: Expose Spark Operator control-plane version via public ConfigMap (#3225)

* Expose Spark-Operator Version via public ConfigMap

Signed-off-by: Surya Sameer Datta Vaddadi <f20220373@goa.bits-pilani.ac.in>

* Update charts/spark-operator-chart/templates/public-configmap.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Surya Sameer Datta Vaddadi <137607947+sameerdattav@users.noreply.github.com>

* Update charts/spark-operator-chart/templates/_helpers.tpl

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Surya Sameer Datta Vaddadi <137607947+sameerdattav@users.noreply.github.com>

* Fixed naming conventions

Signed-off-by: Surya Sameer Datta Vaddadi <f20220373@goa.bits-pilani.ac.in>

* changed all crlf to lf

Signed-off-by: Surya Sameer Datta Vaddadi <f20220373@goa.bits-pilani.ac.in>

* Added the ConfigMap to kustomize and modified rbac to match requirements

Signed-off-by: Surya Sameer Datta Vaddadi <f20220373@goa.bits-pilani.ac.in>

* Rbac added and changed naming

Signed-off-by: Surya Sameer Datta Vaddadi <f20220373@goa.bits-pilani.ac.in>

* feat: expose control-plane version via kubeflow-spark-public ConfigMap

Signed-off-by: tariq-hasan <mmtariquehsn@gmail.com>

* feat(chart): make kubeflow-spark-public ConfigMap opt-in with configurable namespace

Signed-off-by: Tariq Hasan <mmtariquehsn@gmail.com>

---------

Signed-off-by: Surya Sameer Datta Vaddadi <f20220373@goa.bits-pilani.ac.in>
Signed-off-by: Surya Sameer Datta Vaddadi <137607947+sameerdattav@users.noreply.github.com>
Signed-off-by: tariq-hasan <mmtariquehsn@gmail.com>
Signed-off-by: Tariq Hasan <mmtariquehsn@gmail.com>
Co-authored-by: Surya Sameer Datta Vaddadi <f20220373@goa.bits-pilani.ac.in>
Co-authored-by: Surya Sameer Datta Vaddadi <137607947+sameerdattav@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore(deps): bump certifi from 2026.5.20 to 2026.10.19 in /docs/website (#3255)

Bumps [certifi](https://github.com/certifi/python-certifi) from 2026.5.20 to 2026.10.19.
- [Commits](https://github.com/certifi/python-certifi/compare/2026.05.20...2026.10.19)

---
updated-dependencies:
- dependency-name: certifi
  dependency-version: 2026.10.19
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: show how to set runtimeClassName with pod templates (#3248)

There is no direct field for runtimeClassName, but it works through the
driver and executor pod templates. Add a short section to the
SparkApplication guide with an example, and note the error you get when
the installed CRD is older than v2.1.0.

Relates to #3026

Signed-off-by: Peter Bryant <pwbryant1@gmail.com>

* fix(scheduledsparkapplication): don't panic on negative history limits (#3229)

bookkeepPastRuns sliced apps[:limit] without checking for a negative limit, so a value like -1 panicked after the run was already created and before status was saved. Clamp to 0.

Fixes #3228

Signed-off-by: Aditya Raut <rautaditya2606@gmail.com>

* feat(ci): add required boilerplate (license header) check (#3213)

* chore: normalize copyright headers to the Kubeflow boilerplate

Align existing headers with the templates in kubeflow/testing
(hack/boilerplate): "The Kubeflow Authors", the http://www.apache.org
license URL, consistent indentation, and {{- /* ... */ -}} delimiters
in Helm templates. Existing copyright years are kept. Add the year-less
header to checked files that had none.

Files copyrighted by Google LLC, The Kubernetes Authors or
spark-operator contributors keep their original notice.

Part of #2139

Signed-off-by: Vidyansh <ezboi2312@gmail.com>

* chore: emit the boilerplate header from code generators

controller-gen and openapi-generator emit no license header, so
`make manifests` and hack/python-api/gen-api.sh now prepend the
year-less boilerplate to their output, as kubeflow/trainer does.

Move hack/boilerplate.go.txt to hack/boilerplate/ next to the new
boilerplate.sh.txt and switch it to the Kubeflow template, so
controller-gen, code-generator and openapi-gen produce the same
header. Regenerate the affected files.

Part of #2139

Signed-off-by: Vidyansh <ezboi2312@gmail.com>

* feat(ci): verify boilerplate headers with the shared Kubeflow action

Add code-quality-check.yaml, modeled on the workflows in kubeflow/sdk
and kubeflow/trainer, which runs kubeflow/testing's verify-boilerplate
action on pushes and pull requests. It checks that every Go, Python,
shell, YAML, Dockerfile and Helm template file carries the Kubeflow
Apache 2.0 header and that newly added files use the year-less form.
Only files that keep a third-party copyright notice are excluded.

Fixes #2139

Signed-off-by: Vidyansh <ezboi2312@gmail.com>

---------

Signed-off-by: Vidyansh <ezboi2312@gmail.com>

* test(scheduler): add unit tests for the batch scheduler registry (#3232)

* added internal/scheduler/registry_test.go

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* test(scheduler): convert registry tests to Ginkgo

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* feat(sparkconnect): add a `Dependencies` field to `SparkConnectSpec` (#3120)

* feat: add a dependencies field to SparkConnectSpec

Add spec.deps to Spark Connect with the Maven-related fields from the
review: jars, packages, excludePackages, and repositories. The
controller passes them to spark-submit as --jars, --packages,
--exclude-packages, and --repositories.

- Regenerate the deepcopy, OpenAPI, Swagger, CRD, API docs, and Python
  API artifacts.
- Document .spec.deps in the Spark Connect user guide.
- Add examples/sparkconnect/spark-connect-dependencies.yaml.
- Add an e2e test that starts the server from the new example and
  checks that the dependency flags reach spark-submit.
- Drop two unnecessary string conversions flagged by golangci-lint.

Fixes #2959

Signed-off-by: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com>

* Address the review on the SparkConnect dependencies example and e2e

- Match examples/sparkconnect/spark-connect.yaml apart from spec.deps so the
  e2e isolates the dependency behaviour, and use external artifacts that are
  not already in the base Spark image (re2j jar, spark-avro package, with
  transitive excludePackages). Drop spec.repositories since Maven Central is
  already in the runtime and third-party archives add no signal.
- Use the Kubeflow Authors boilerplate in both files.
- e2e now waits for server and executor pod readiness and runs an actual
  Spark Connect query that resolves the declared spark-avro package
  (to_avro), instead of asserting the container args that the unit tests
  already cover.

Signed-off-by: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com>

* Fix ci failed on #3120: Set `spark.jars.ivy=/tmp/.ivy2` in Spark Connect server subm

Signed-off-by: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com>

* test(e2e): run the SparkConnect dependency query on the server session

The dependency e2e drove spark-shell with --master 'local[1]', which selects
the Classic session; the .remote() URL is ignored in that mode, so to_avro was
evaluated on the client JVM and never reached the server. That produced a
failure that looked like a dependency problem but was a client-mode problem,
and the same query 'passed' against no server at all.

Drive the Connect REPL through a pty instead. That keeps the client a real
Spark Connect session, so the query runs against the operator's server and
sees the packages declared in spec.deps. The helper also asserts the session
type, so a classic fallback fails loudly rather than silently.

Signed-off-by: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com>

* test(e2e): assert declared dependency values and add the license header

Addresses the remaining review points on #3120:

- Add the Kubeflow license header above the helper's docstring.
- Prove both halves of spec.deps resolve on the server session by asserting on
  values: hex(to_avro(42)) from the declared spark-avro package, and
  reflect('com.google.re2j.Pattern', ...) from the declared jar. A row count
  could pass with only one of them present.
- Assert AVRO=54 and RE2J=true in the Go test instead of CONNECT_ROWS=10.
- Drop the explanatory comment from the example manifest as requested.

Verified against a local Spark Connect server started with this example's
spec.deps: AVRO=54, RE2J=true.

Signed-off-by: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com>

* style: match the Kubeflow boilerplate and drop two comments

The example manifest began with a bare '#' line before the copyright, which the
testing repo's boilerplate does not have. The e2e helper and its Go assertion
also carried explanatory comments the reviewer asked to remove.

Signed-off-by: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com>

---------

Signed-off-by: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com>

* chore: fix CI failures on master (boilerplate headers, ubuntu-26.04 runner) (#3271)

* chore: fix boilerplate headers in scheduler registry tests

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* chore: add missing boilerplate header to generated SparkConnect Dependencies model

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* ci: bump actions-setup-minikube to v2.19.0 for ubuntu-26.04 runners

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* ci: load single-platform Spark image into kind for Docker 29

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* fix(sparkconnect): use server.cores as server pod CPU request (#3252)

* fix(sparkconnect): use server.cores as server pod CPU request

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* chore: regenerate SparkConnect API artifacts

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* test(sparkconnect): cover server.cores as CPU request

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* test: cover server.cores validation

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* docs(sparkconnect): document server.cores as coreRequest shorthand. The documentation change was generated with help from Claude.

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* Update internal/controller/sparkconnect/reconciler.go

Co-authored-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
Signed-off-by: Vikas Saxena <90456542+vikas-saxena02@users.noreply.github.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <90456542+vikas-saxena02@users.noreply.github.com>
Co-authored-by: Manabu McCloskey <manabu.mccloskey@gmail.com>

* feat(ci): automate the release process (#3226)

* feat(ci): automate the release process

Signed-off-by: tariq-hasan <mmtariquehsn@gmail.com>

* fix(ci): address release automation review comments

Signed-off-by: Tariq Hasan <mmtariquehsn@gmail.com>

* fix(ci): update docs

Signed-off-by: Tariq Hasan <mmtariquehsn@gmail.com>

* fix(ci): align release automation with the public ConfigMap and harden publishing

Signed-off-by: Tariq Hasan <mmtariquehsn@gmail.com>

---------

Signed-off-by: tariq-hasan <mmtariquehsn@gmail.com>
Signed-off-by: Tariq Hasan <mmtariquehsn@gmail.com>

* feat: upgrade Spark runtime to 4.2.1 (#3245)

Add Makefile-backed update and verification tooling for managed Spark runtime references.

Signed-off-by: Shitanshu Pandey <shitanshu.19p@gmail.com>

* feat(api): deprecate client deploy mode for SparkApplication (#3270)

* api: mark client deploy mode as deprecated in v1beta2

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* api: add Go Deprecated marker to client deploy mode constants

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* webhook: warn on deprecated client deploy mode

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* webhook: test client mode deprecation warning

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* controller: log warning when submitting client mode SparkApplication

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* docs: document client deploy mode deprecation

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* docs: drop in-cluster-client from deprecation warning

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* webhook: test client mode warning on ScheduledSparkApplication update

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

---------

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>

* chore: release v2.6.0-rc.0 (#3287)

Signed-off-by: Tariq Hasan <mmtariquehsn@gmail.com>

* fix(kustomize): remove stale OPERATOR_VERSION from controller deployment (#3291)

Signed-off-by: Tariq Hasan <mmtariquehsn@gmail.com>

* fix(controller): resolve {{SPARK_VERSION}} in images with the appliction's Spark version (#3292)

Spark replaces {{SPARK_VERSION}} in container image properties with the
version of the Spark that builds the driver pod. That is the operator
image's Spark for spark-submit and the submitter's Spark for the
RestSubmitter, not the version the application declares.

On a v2.6.0-rc.0 cluster an application with sparkVersion 4.3.0 and
image apache/spark:{{SPARK_VERSION}} ran apache/spark:4.2.1 through
spark-submit, and failed with InvalidImageName through the RestSubmitter
(built on Spark 4.0.1, which does not substitute the placeholder).

Substitute the placeholder with .spec.sparkVersion in .spec.image,
.spec.driver.image, .spec.executor.image and spark.kubernetes.*container.image
entries in .spec.sparkConf before building the submit arguments, matching
apache/spark-kubernetes-operator. An empty sparkVersion keeps the
placeholder for Spark to resolve.

Signed-off-by: vara-bonthu <vara.bonthu@gmail.com>

* chore: reconcile midstream integrations after upstream sync

Signed-off-by: roburishabh <roburishabh@outlook.com>

* ci: reconcile boilerplate checks for midstream files

Signed-off-by: roburishabh <roburishabh@outlook.com>

* chore: omit upstream agent instructions from midstream sync

Signed-off-by: roburishabh <roburishabh@outlook.com>

* Revert "chore: omit upstream agent instructions from midstream sync"

This reverts commit f1a795bd5b4e959c772f28af53b0ff9888826d7a.

* test(e2e): use the Connect server image for the SparkConnect client pod

The root Dockerfile now builds on the Scala-only Spark base image, which
ships no python3/pip, so the operator image can no longer drive the PySpark
Spark Connect client (the pip install step failed with 'python3: command
not found').

Run the client pod from the Spark Connect server's own image instead: it
bundles python3 plus the PySpark distribution matching the server's Spark
version, which Spark Connect requires the client and server to share, and
mirrors the documented RHOAI workbench flow. Switch the pull policy to
IfNotPresent since the image now comes from a registry rather than being
pre-loaded into Kind.

Also add zstandard to the pip-installed Connect client dependencies,
required at import time by the PySpark 4.2+ Connect client.

Signed-off-by: Ali Maredia <amaredia@redhat.com>

---------

Signed-off-by: Jay Bharadwaj <jbharadw@openai.com>
Signed-off-by: Tamir Krasna <64045253+Tankdoggo@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <90456542+vikas-saxena02@users.noreply.github.com>
Signed-off-by: dineshkumar181094 <dineshkumar181094@gmail.com>
Signed-off-by: immanuwell <pchpr.00@list.ru>
Signed-off-by: Vidyansh <ezboi2312@gmail.com>
Signed-off-by: rjgoyln <pt40419@gmail.com>
Signed-off-by: rohith1X8 <rohith18p18@gmail.com>
Signed-off-by: mosa0519 <mohanakrishna.sadhu@netcracker.com>
Signed-off-by: Fumer057 <fumer057@users.noreply.github.com>
Signed-off-by: Pujitha…
@vara-bonthu
vara-bonthu deleted the fix/spark-version-image-substitution branch November 22, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants