Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
contrived example was actually wrong
Signed-off-by: Blake <blaketastic2@gmail.com>
  • Loading branch information
blaketastic2 committed Oct 20, 2025
commit 6a079506e17c6c38e1726918d61c40584e7ecc6e
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,7 @@ var _ = Describe("Registry Service", func() {
Expect(deployment.Spec.Template.Spec.NodeSelector).To(Equal(expectedNodeSelector))
})

It("should merge operator NodeSelector with existing selectors (ops team scenario)", func() {
// Simulate existing node selector from ops team
existingNodeSelector := map[string]string{
"team": "ml",
"environment": "prod",
}

It("should merge operator NodeSelector with existing selectors (mutating webhook scenario)", func() {
// Set NodeSelector for UI service
uiNodeSelector := map[string]string{
"node-type": "ui",
Expand All @@ -302,12 +296,23 @@ var _ = Describe("Registry Service", func() {
applySpecToStatus(featureStore)
feast.refreshFeatureStore(ctx, typeNamespacedName)

// Create deployment and simulate existing node selector
// Create deployment first
deployment := feast.initFeastDeploy()
deployment.Spec.Template.Spec.NodeSelector = existingNodeSelector
Expect(deployment).NotTo(BeNil())
Expect(feast.setDeployment(deployment)).To(Succeed())

// Simulate a mutating webhook or admission controller adding node selectors
// This would happen after the operator creates the pod spec but before scheduling
existingNodeSelector := map[string]string{
"team": "ml",
"environment": "prod",
}
deployment.Spec.Template.Spec.NodeSelector = existingNodeSelector

// Apply the node selector logic again to test merging
// This simulates the operator reconciling and re-applying node selectors
feast.applyNodeSelector(&deployment.Spec.Template.Spec)

// Verify NodeSelector merges existing and operator selectors
expectedNodeSelector := map[string]string{
"team": "ml",
Expand Down
Loading