-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ctlv3: support ETCDCTL_WATCH_KEY, ETCDCTL_WATCH_RANGE_END #9142
Conversation
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #9142 +/- ##
=========================================
Coverage ? 76.01%
=========================================
Files ? 359
Lines ? 30038
Branches ? 0
=========================================
Hits ? 22833
Misses ? 5618
Partials ? 1587
Continue to review full report at Codecov.
|
I will give it a try in the next days. However, in the comments #8919 (comment) and #8919 (comment) me and @debovema meant different set of variables. The variables ( In this comment, you referenced the proper values that should be set before the execution of the command. Consider this trivial scenario:
|
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
@vikin91 Just added ./etcdctl watch foo -- sh -c "env | grep ETCD_WATCH_"
# PUT
# foo
# bar
# ETCD_WATCH_REVISION=11
# ETCD_WATCH_KEY="foo"
# ETCD_WATCH_EVENT_TYPE="PUT"
# ETCD_WATCH_VALUE="bar" It will be set for each event. Think of |
Fantastic, thanks! I will get back to you as soon as I test it. Hopefully in the next 48hrs. |
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right to me. Docs and tests look comprehensive.
lgtm
Sorry for reporting back so late - so far it works for me as expected. Many thanks for this PR! |
Below works and reports only events on foo (and ignore foo1) This DOES NOT work and reports all types of events (PUT OR DELETE). ETCD_WATCH_EVENT_TYPE=PUT etcdctl watch foo -- sh -c 'env |grep ETCD_WATCH' ETCD_WATCH_KEY="foo"
2023-05-11 16:22:39.793490 W | pkg/flags: unrecognized environment variable ETCDCTL_WATCH_EVENT_TYPE=PUT Any way of making this work ? |
Parsing logic became more complicated, but added test cases should cover all edge cases.
Can you give this a try @debovema @vikin91 @wwyiwzhang @pldmgg ?
ref. #8919 (comment)
#8814