Skip to content

fix(operator): Only deploy an online store when it is declared#6591

Open
nikolauspschuetz wants to merge 2 commits into
feast-dev:masterfrom
nikolauspschuetz:fix/operator-optional-online-store-6586
Open

fix(operator): Only deploy an online store when it is declared#6591
nikolauspschuetz wants to merge 2 commits into
feast-dev:masterfrom
nikolauspschuetz:fix/operator-optional-online-store-6586

Conversation

@nikolauspschuetz

Copy link
Copy Markdown
Contributor

Closes #6586.

Problem

The Feast operator always deployed an online store service (including a serving pod), even when the FeatureStore CR did not declare spec.services.onlineStore. This makes it impossible to run a standalone registry or offline store (e.g. the documented federated / shared-registry pattern), and is inconsistent with how registry and offlineStore behave — both are only defaulted when declared.

Cause

In ApplyDefaultsToStatus (infra/feast-operator/internal/controller/services/util.go), the online-store block force-created the service when nil:

if services.OnlineStore == nil {
    services.OnlineStore = &feastdevv1.OnlineStore{}
}
// ...defaults always applied...

whereas registry and offlineStore are gated behind if services.X != nil.

Fix

Gate the online-store defaulting behind services.OnlineStore != nil, mirroring the two sibling services. A declared online store still receives all of its defaults (persistence, path, PVC, server, container configs).

Tests

Added util_test.go with two specs for ApplyDefaultsToStatus:

  • a CR without an online store → Status.Applied.Services.OnlineStore stays nil (fails on master, passes with this change),
  • a CR that declares an online store → it still receives its defaults.

Verified with KUBEBUILDER_ASSETS=... go test ./internal/controller/services/ (envtest 1.31.0); go build ./..., go vet, and gofmt are clean. The existing controller tests are unaffected because they declare onlineStore explicitly.

ApplyDefaultsToStatus created an online store service (including a serving
pod) whenever spec.services.onlineStore was omitted, so the operator always
deployed an online store even for a standalone registry or offline store.
This contradicts the documented federated / shared-registry pattern and
differs from how registry and offlineStore behave (both are only defaulted
when declared).

Gate the online-store defaulting behind `services.OnlineStore != nil`,
mirroring registry and offlineStore. A declared online store still receives
all of its defaults. Adds unit coverage for both cases.

Closes feast-dev#6586

Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
@nikolauspschuetz nikolauspschuetz requested a review from a team as a code owner July 9, 2026 04:18
@nikolauspschuetz nikolauspschuetz changed the title fix(operator): only deploy an online store when it is declared fix(operator): Only deploy an online store when it is declared Jul 9, 2026
…on the implicit default

The operator no longer creates an online store when a FeatureStore omits
spec.services.onlineStore (feast-dev#6586). These existing tests built CRs that
declared other services (or nothing) and relied on the online store being
created implicitly, so they now either fail the "at least one local server"
guard or find no online container/service.

Declare the online store explicitly where the test intent is to exercise an
online store, and assert its absence in the registry+offlineStore case so it
also serves as a regression check for feast-dev#6586.

Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
@nikolauspschuetz

Copy link
Copy Markdown
Contributor Author

The red `unit-test-python (3.11, macos-14)` leg is an unrelated CI flake, not caused by this change (which is Go-only, scoped to `infra/feast-operator/`):

```
ERROR sdk/python/tests/unit/test_feature_server.py::test_push_and_get
AssertionError: stdout: b''
stderr: b"Command timed out after 120s: [\x27apply\x27]"
2259 passed, 47 skipped, 1 error
```

A `feast apply` subprocess timed out after 120s on the macOS-14 runner. The macOS-3.12 leg and all Ubuntu legs (3.10/3.11/3.12) passed on this same commit, and `operator-test` is green. I do not have permission to re-run the job from the fork — a maintainer re-run of that single leg should clear it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feast operator always deploys an online store, regardless of CR configuration

1 participant