Repository navigation
Conversation
|
@uberstoic Hi, can you update the PR? it's a little bit out-of-date and has conflicts. I will review it soon once you update it. |
e07eff2 to
7157c4b
Compare
|
@shuchu hi! |
There was a problem hiding this comment.
Devin Review found 1 potential issue.
3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| if data, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil { | ||
| if ns := strings.TrimSpace(string(data)); ns != "" { | ||
| logger.V(1).Info("Using operator namespace from serviceaccount namespace file", "namespace", ns) | ||
| return ns, nil |
There was a problem hiding this comment.
🟡 Stale discovery entries after upgrade
After a custom-namespace Kubernetes upgrade, getNamespaceRegistryNamespace redirects writes and cleanup away from the existing discovery ConfigMaps. Clients still reading feast-operator-system miss new stores and keep seeing deleted stores and OpenLineage endpoints.
Learn more
The namespace registry and OpenLineage discovery ConfigMaps tell clients which stores and endpoints exist. Before this change, Kubernetes installs wrote both to feast-operator-system, even when the operator ran elsewhere. On upgrade, deployNamespaceRegistry and deployOpenLineageDiscovery start writing to the pod namespace. The shared ConfigMaps have no owner references, and RemoveFromNamespaceRegistry and RemoveFromOpenLineageDiscovery only clean up the newly resolved namespace. Clients following the namespace registry lookup can therefore keep reading a valid but stale ConfigMap for as long as the old namespace remains.
Example: An operator in ml-platform previously registered fraud in an existing feast-operator-system namespace. Upgrade the operator without an explicit namespace override, then delete fraud. The old ConfigMap still advertises fraud, and a dashboard reading there does not see stores created after the upgrade.
Recommended fix: Provide an upgrade path for both discovery ConfigMaps. Preserve the old target with FEAST_OPERATOR_NAMESPACE=feast-operator-system until readers are migrated, or migrate readers and retire the old ConfigMaps explicitly. Do not delete shared ConfigMaps blindly when another operator may still use them. Add an upgrade test covering a custom operator namespace with pre-existing discovery entries.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
added a compatibility path for existing Kubernetes installs: when a legacy discovery ConfigMap exists in feast-operator-system, the operator now keeps this FeatureStore’s entry in sync there as well as in its current namespace, for both the namespace registry and OpenLineage discovery.
Cleanup only removes this FeatureStore’s entry; shared ConfigMaps and unrelated entries are preserved. I also added upgrade tests and documented the legacy namespace behavior
Separate commit for this fix is in the last commit
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6477 +/- ##
==========================================
- Coverage 54.10% 54.10% -0.01%
==========================================
Files 467 467
Lines 58940 58940
Branches 8688 8688
==========================================
- Hits 31890 31889 -1
Misses 24892 24892
- Partials 2158 2159 +1
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…east-operator-system Resolves feast-dev#5823 Signed-off-by: Serj <serjpvlv@gmail.com>
Signed-off-by: Sergej Pavloff <sergejpavloff@MacBook-Air-Sergej.local>
3ba6988 to
2fc42d1
Compare
Signed-off-by: Serj <107816087+uberstoic@users.noreply.github.com>
|
Hi! I fixed the errcheck lint issues in the operator tests, rebased the PR onto the latest master, and updated the PR title to satisfy the title check + fixed what devin-ai mentioned (see above) |
What this PR does / why we need it:
When the Feast Operator is deployed to a custom namespace (not
feast-operator-system), it fails to reconcile FeatureStore CRs because [getNamespaceRegistryNamespace()] returned a hardcodedfeast-operator-systemon non-OpenShift clusters.This PR fixes the namespace resolution logic to dynamically determine the operator's actual namespace using a priority chain:
FEAST_OPERATOR_NAMESPACEenv var (explicit override)/var/run/secrets/kubernetes.io/serviceaccount/namespace(works on both K8s and OpenShift)POD_NAMESPACEenv var (Downward API)feast-operator-system(unit tests only)The
isOpenShiftguard was removed from the SA file check since this file is available on both Kubernetes and OpenShift. The function signature was simplified from(string, error)tostringso it now always returns a usable namespace.Which issue(s) this PR fixes:
Fixes #5823
Checks
git commit -s)Testing Strategy
Misc
Added 6 unit tests in namespace_registry_test.go covering the env var priority chain and fallback behavior.
P.S.
My first contribution to open-source, sorry if I do something wrong.