SinkBinding doesn't work with KServices that uses BYO revision names
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 1.2k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 2
Description
**Describe the bug**
When using a `SinkBinding` with a Knative Service as subject that uses BYO revision names (i.e. setting the revision name from the client), then no `K_SINK` environment variable is injected to the KService.
**Expected behavior**
`K_SINK` should be injected to the Pod Template as a container env var regardless whether a Knative Service is configured for BYO revision names or not.
**To Reproduce**
```
kn service create random --image rhuss/random:1.0
kn broker create default
kn source binding create my-sb --subject Service:serving.knative.dev/v1:random --sink broker:default
kn service describe random --verbose | grep K_SINK
```
This will get no result as `kn` used BYO revision names by default. If switching over to server side generated names, then a K_SINK env var is injected.
```
# Switch over to server side generated names
kn service update random --revision-name ""
kn service describe random --verbose | grep K_SINK
Env: K_SINK=http://broker-ingress.knative-eventing.svc.cluster.local/default/default
```
**Knative release version**
Eventing 0.17.3 (running on minikube)
Contributor guide
Research direction
Start by reproducing the issue with the provided kn service, broker, and source binding commands, comparing BYO revision names with server-side generated names. Trace SinkBinding handling for the KService Pod Template and verify that K_SINK is injected in both configurations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100