-
Notifications
You must be signed in to change notification settings - Fork 277
cli: add proxy command to dump config #1883
Conversation
Adds a cli command to dump proxy configuration for a given pod. Resolves openservicemesh#1762
|
||
//add mesh name flag | ||
f := cmd.Flags() | ||
f.StringVarP(&dumpConfigCmd.namespace, "namespace", "n", metav1.NamespaceDefault, "Namespace of pod") |
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.
There's already a -n/--namespace
flag automatically added to every command from pkg/cli/environment.go to define the control plane namespace. Does it still work to define both the pod namespace and control plane namespace? If the control plane namespace doesn't need to be defined, then do both flags show up in the help text? That would be confusing.
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.
I would not mix the pod namespace with the control plane namespace. This is what the help text looks like:
This command will dump the sidecar proxy configuration for the given pod.
Usage:
osm proxy dump-config POD ... [flags]
Examples:
# Dump the proxy configuration for pod bookbuyer-5ccf77f46d-rc5mg in the bookbuyer namespace
osm proxy dump-config bookbuyer-5ccf77f46d-rc5mg -n bookbuyer
Flags:
-h, --help help for dump-config
-p, --local-port uint16 Local port to use for port forwarding (default 15000)
Global Flags:
-n, --namespace string namespace for osm control plane (default "osm-system")
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.
So then does the flag on the command work to change the pod namespace?
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.
The flag on the command is meant to specify the pod namespace, not to change it. The pod here is the application pod, not the controller pod. If you did specify a controller pod, the command will error due to the controller not being a meshed pod
.
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.
I filed #1884 to track the ambiguity between the namespace flags.
Codecov Report
@@ Coverage Diff @@
## main #1883 +/- ##
==========================================
- Coverage 58.87% 58.43% -0.44%
==========================================
Files 127 129 +2
Lines 5223 5274 +51
==========================================
+ Hits 3075 3082 +7
- Misses 2145 2189 +44
Partials 3 3
Continue to review full report at Codecov.
|
Adds a cli command to dump proxy configuration for a given pod. Resolves openservicemesh#1762
Description:
Adds a cli command to dump proxy configuration
for a given pod. This is useful for debugging
purpose.
Resolves #1762
Affected area:
Please answer the following questions with yes/no.
No