Skip to content

Commit 3075c6c

Browse files
authored
Docs/fix subscription todo comments (#6546)
* docs: resolve TODO comments in subscriptions.md - Add example output for 'kn subscription describe' command - Add comprehensive 'Updating a Subscription' section with kn and kubectl examples - Include three practical update scenarios: changing sink, adding dead letter sink, and updating reply sink - Remove TODO comments once addressed Fixes knative/docs issue with incomplete subscription documentation * fix: correct kn subscription update commands and kubectl syntax - Replace 'kn subscription create' with 'kn subscription update' for updating subscriptions - Remove unnecessary --channel parameter from update commands - Fix 'kubectl subscription delete' to 'kubectl delete subscription' - Simplify update command examples based on actual kn CLI behavior Verified with local Knative cluster testing. * docs: simplify update examples to single comprehensive example Consolidated three separate update examples into one that shows all parameters together. Makes the documentation more concise while still covering all update scenarios. * revert: undo kubectl delete syntax change Reverting kubectl command back to original syntax as requested.
1 parent 6c9f7c1 commit 3075c6c

1 file changed

Lines changed: 71 additions & 2 deletions

File tree

docs/versioned/eventing/channels/subscriptions.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,77 @@ You can print details about a Subscription by using the `kn` CLI tool:
140140
```bash
141141
kn subscription describe <subscription-name>
142142
```
143-
<!--TODO: Add an example command and output-->
144-
<!--TODO: Add details for kn Subscription update - existing generated docs weren't clear enough, need better explained examples-->
143+
144+
**Example:**
145+
146+
```bash
147+
kn subscription describe mysubscription
148+
```
149+
150+
!!! Success "Expected output"
151+
```{ .bash .no-copy }
152+
Name: mysubscription
153+
Namespace: default
154+
Annotations: messaging.knative.dev/creator=user@example.com
155+
messaging.knative.dev/lastModifier=user@example.com
156+
Age: 1h
157+
Channel: Channel:mychannel (messaging.knative.dev/v1)
158+
Subscriber:
159+
URI: http://myservice.default.svc.cluster.local
160+
Reply:
161+
Name: myreply
162+
Kind: InMemoryChannel
163+
API Version: messaging.knative.dev/v1
164+
DeadLetterSink:
165+
Name: mydlq
166+
Kind: Service
167+
API Version: serving.knative.dev/v1
168+
169+
Conditions:
170+
OK TYPE AGE REASON
171+
++ Ready 1h
172+
++ AddedToChannel 1h
173+
++ ChannelReady 1h
174+
```
175+
176+
## Updating a Subscription
177+
178+
You can update an existing Subscription by using the `kn` CLI tool or by applying an updated YAML file.
179+
180+
=== "kn"
181+
Use the `kn subscription update` command to modify an existing Subscription.
182+
183+
**Example:**
184+
185+
```bash
186+
kn subscription update mysubscription \
187+
--sink ksvc:myservice \
188+
--sink-dead-letter ksvc:error-handler \
189+
--sink-reply channel:reply-channel
190+
```
191+
192+
You can update individual parameters as needed:
193+
- `--sink`: Change the subscriber (destination for events)
194+
- `--sink-dead-letter`: Add or update the dead letter sink for failed deliveries
195+
- `--sink-reply`: Update where reply events are sent
196+
197+
!!! note
198+
When updating a Subscription, you must provide all the configuration parameters you want to keep. Any parameters not specified in the update command will use default values.
199+
200+
=== "kubectl"
201+
1. Get the current Subscription configuration:
202+
203+
```bash
204+
kubectl get subscription <subscription-name> -o yaml > subscription.yaml
205+
```
206+
207+
1. Edit the YAML file to make your desired changes to the `spec` section.
208+
209+
1. Apply the updated YAML file:
210+
211+
```bash
212+
kubectl apply -f subscription.yaml
213+
```
145214

146215
## Deleting Subscriptions
147216

0 commit comments

Comments
 (0)