knative / knative/eventing

SinkBinding matching a subject using labels doesn't update the subject when label is removed

Open
#5,835 0 comments 0 reactions 0 assignees View on GitHub
kind/bug priority/important-soon triage/accepted
Dominant language
Go
Stars
1.6k
Forks
631
Avg merge
2d 1h
Merged PRs (30d)
6

Description

**Describe the bug**
When a SinkBinding is created with a subject using labels
```
kn source binding create bind-event-display --subject Service:serving.knative.dev/v1:foo=bar --sink ksvc:event-display
```
The binding injects expected variables like `K_SINK` into a Knative Service such as
```
kn service create hello --image SOME_IMAGE -l foo=bar
```

When the service is updated to remove the label
```
kn service update hello -l foo-
```
The binding injected variables are still present in the Knative Service
```
kubectl describe ksvc/hello
.
..
Spec:
Container Concurrency: 0
Containers:
Env:
Name: TARGET
Value: World
Name: K_SINK
Value: http://event-display.default.svc.cluster.local
Name: K_CE_OVERRIDES
Image: gcr.io/knative-samples/helloworld-go@sha256:5ea96ba4b872685ff4ddb5cd8d1a97ec18c18fae79ee8df0d29f446c5efe5f50
Name: user-container
```

**Expected behavior**
The binding injected variables are removed when a subject's matching label is no longer present

**To Reproduce**
See steps above
**Knative release version**
v0.26.0

Contributor guide

Open the contributing guide

Research direction

Start by tracing the SinkBinding subject-label matching and reconciliation path, using the reproduction to inspect what happens after the foo label is removed. Done means the binding-injected variables are removed from the Knative Service when the subject no longer matches.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.