Skip to content

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

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
nikolauspschuetz:fix/operator-optional-online-store-6586
Jul 30, 2026
Merged

fix(operator): Only deploy an online store when it is declared#6591
ntkathole merged 1 commit 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.

@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
@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.

Copilot AI 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.

Pull request overview

This PR updates the Feast Kubernetes operator’s defaulting logic so an online store service is only deployed when spec.services.onlineStore is explicitly declared, matching the existing behavior for registry and offlineStore. This enables FeatureStore deployments that intentionally omit the online store (e.g., registry-only / offline-only patterns).

Changes:

  • Gate online-store defaulting in ApplyDefaultsToStatus behind services.OnlineStore != nil to avoid implicitly creating/deploying an online store.
  • Add unit tests covering both “onlineStore omitted” and “onlineStore declared” behaviors.
  • Update existing controller/service tests to explicitly declare onlineStore where those tests still require an online store to exist.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
infra/feast-operator/internal/controller/services/util.go Stop implicitly creating online-store defaults unless the online store is declared.
infra/feast-operator/internal/controller/services/util_test.go Add regression/unit tests for online-store defaulting behavior.
infra/feast-operator/internal/controller/services/tls_test.go Explicitly declare onlineStore so TLS defaulting assertions remain valid.
infra/feast-operator/internal/controller/services/repo_config_test.go Adjust expectations/helpers to reflect that online store is no longer implicit.
infra/feast-operator/internal/controller/featurestore_controller_test.go Ensure test FeatureStores declare onlineStore where required for validity.
infra/feast-operator/internal/controller/featurestore_controller_loglevel_test.go Explicitly include onlineStore in the test services spec.
infra/feast-operator/internal/controller/featurestore_controller_cronjob_test.go Ensure test FeatureStores declare onlineStore where required for validity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +166 to +170
// Only apply online store defaults when the online store is declared, so a
// FeatureStore can omit spec.services.onlineStore (mirroring registry and
// offlineStore) and not have an online store deployed. (#6586)
if services.OnlineStore != nil {
if services.OnlineStore.Persistence == nil {
@ntkathole

Copy link
Copy Markdown
Member

@nikolauspschuetz instead I think fix should be to allow online server deployment to opt-out.

@nikolauspschuetz

Copy link
Copy Markdown
Contributor Author

Thanks @ntkathole — that makes sense for backward compatibility. Omitting onlineStore today implicitly deploys one, so flipping that default (what this PR currently does) is a breaking change on upgrade for anyone relying on the implicit default.

To make it opt-out instead, I'd keep the current default-on behavior and add an explicit disable switch on the online store spec, mirroring the existing DisableInitContainers idiom already in the CRD:

type OnlineStore struct {
    // Disabled skips deploying the online store service.
    // +optional
    Disabled bool `json:"disabled,omitempty"`

    Server      *ServerConfigs          `json:"server,omitempty"`
    Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
    // ...
}

ApplyDefaultsToStatus would skip the onlineStore defaulting/deployment when disabled is true; omitting the block keeps deploying it exactly as before. The standalone-registry / federated pattern from #6586 would then be expressed explicitly as spec.services.onlineStore.disabled: true.

One clarification so I build the right thing: do you want the opt-out at the whole online-store level (skip both persistence and the serving pod), or only the online server (serving pod), keeping the online store config? Happy to rework the PR either way once you confirm.

@ntkathole

Copy link
Copy Markdown
Member

opt-out at the whole online-store level (skip both persistence and the serving pod), or only the online server (serving pod), keeping the online store config?

opt-out at the whole onlineStore level (disabled: true), not server-only.

@nikolauspschuetz
nikolauspschuetz force-pushed the fix/operator-optional-online-store-6586 branch from 4a735a8 to 1008ca2 Compare July 20, 2026 18:11
@nikolauspschuetz

Copy link
Copy Markdown
Contributor Author

Thanks — reworked it to opt-out. The default is back to deploying the online store, so nothing changes on upgrade for existing setups. Setting spec.services.onlineStore.disabled: true now skips it entirely (serving pod and persistence), which covers the registry-only / offline-only case from #6586. It's gated through isOnlineStore(), so metrics and the service monitor drop off with it too.

@nikolauspschuetz
nikolauspschuetz force-pushed the fix/operator-optional-online-store-6586 branch from 1008ca2 to 6a27e6b Compare July 20, 2026 18:19
@ntkathole

Copy link
Copy Markdown
Member

@nikolauspschuetz Please resolve conflicts

@nikolauspschuetz
nikolauspschuetz force-pushed the fix/operator-optional-online-store-6586 branch from 6a27e6b to a23197b Compare July 30, 2026 07:08
@nikolauspschuetz

Copy link
Copy Markdown
Contributor Author

Rebased onto master and resolved the conflict, @ntkathole. The only conflict was in .secrets.baseline (a shifted line_number and the generated_at timestamp — my disabled field pushed the tracked line in featurestore_types.go from 937 to 941); the operator code merged cleanly.

Ran the operator suite locally against the envtest harness (k8s 1.31.0) after the rebase — internal/controller/services passes, including the isOnlineStore / disabled: true cases in util_test.go. Ready for another look.

@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.35%. Comparing base (0f149a9) to head (a5466a5).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6591   +/-   ##
=======================================
  Coverage   46.35%   46.35%           
=======================================
  Files         414      414           
  Lines       50052    50052           
  Branches     7151     7151           
=======================================
  Hits        23201    23201           
  Misses      25229    25229           
  Partials     1622     1622           
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 47.65% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f149a9...a5466a5. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntkathole

Copy link
Copy Markdown
Member

@nikolauspschuetz need to fix linting

…he online store

The operator always deploys an online store, forcing a serving pod and
persistence onto registry-only or offline-only FeatureStores (feast-dev#6586). Add a
`disabled` field on the online store spec to opt those deployments out
explicitly. Deployment is gated through isOnlineStore(), so disabling also
skips the serving pod, metrics, and service monitor. The default is unchanged
-- omitting the online store block still deploys it with defaults -- so this
is not a breaking change on upgrade.

Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
@nikolauspschuetz
nikolauspschuetz force-pushed the fix/operator-optional-online-store-6586 branch from a23197b to a5466a5 Compare July 30, 2026 07:41
@ntkathole
ntkathole merged commit d81d4e3 into feast-dev:master Jul 30, 2026
26 checks passed
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.

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

4 participants