-
Notifications
You must be signed in to change notification settings - Fork 3.4k
cilium-dbg: Replace statedb command with "shell -- db show" #35545
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
Conversation
21a22dc
to
26419af
Compare
Hmm, since this is completely changing how "cilium-dbg statedb" command works, we could also just change the command to "cilium-dbg db". This way it'll also match the script command, and the help matches as well. Or another option would be to kill the statedb command completely and instead just invoke these with Also one annoying thing with this wrapper is that flag parsing will get mixed and requires quotes:
Not quite sure what to do about this. One option I guess is to not use flags in the "db" command and instead do some sort of query language. The flags are convenient to implement though and provide some command line usage help without much extra work. I'm somewhat starting to lean towards just killing the "cilium-dbg statedb" command completely and exposing these via "cilium-dbg shell" only. If one is interested in poking at the database then you'll likely anyway want to go via |
That's unfortunate but I agree that that having them as flags with easy usage documentation provides a lot of benefits. We should just make sure to document the fact that flags needs to be quoted. If the need arises we could still switch to a query language.
+1 IMO this way would provide a more streamlined to the user and it also makes it easier to "transfer" commands used during an interactive session to a single non-interactive |
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.
Looks good, nice and clean! Two nits inline.
I've left my comments wrt. killing the statedb
subcommand in a separate reply and I'll let you decide on how you want to move forward with this.
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.
Vendor changes LGTM 🚀
Thanks! I think simplifying is the way to go, but I don't want to leave folks used to "cilium-dbg statedb" confused. I'll make the "cilium-dbg statedb" just spit out a "deprecated message" that tells how to do the same things with |
26419af
to
216f6cc
Compare
8c0f161
to
243b05a
Compare
/test |
The "cilium-dbg statedb" command now returns a deprecated text that shows how to use the "cilium-dbg shell -- db" commands. We'll remove it fully in next release. The "cilium-dbg statedb dump" will probably need to be kept as a hidden command for bugtool compatibility. This removes the need to list all tables we want to inspect in statedb.go and the need to import bunch of agent packages to pull in the object types. Signed-off-by: Jussi Maki <jussi@isovalent.com>
To support queries using a string with the "db" script commands, add "FromString" implementation to all StateDB indexes. Signed-off-by: Jussi Maki <jussi@isovalent.com>
243b05a
to
4a06fff
Compare
/test |
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.
egress-gateway changes LGTM 💯
tl;dr:
cilium-dbg statedb <table>
commands now becomescilium-dbg shell -- db show <table>
.cilium-dbg statedb
shows a deprecated disclaimer and example usage ofshell -- db
.