-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Support optional args in diagnostics #14640
Comments
The command has a few flags directed at specific diagnostics, like So would this imply there should be a generic parameter specifically for passing parameters for specific diagnostics? Something like: This would have the disadvantage of not being discoverable via the usual -h flag (we could introduce a flag specifically for listing them, though) and not being name-checked or type-checked/converted by pflag. Obviously this is just as true for env vars and probably any solution we could come up with that's not formal flags. |
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Adds the ability to specify parameters for individual diagnostics on the command line (without proliferating flags). Addresses openshift#14640
Automatic merge from submit-queue. diagnostics: individual parameters Updated version of #16589 based on feedback. This addresses #14640 by making individual diagnostics into subcommands that can have their own flags. Existing top-level flags for `NetworkCheck` are removed and the config envvar for `EtcdWriteVolume` is deprecated in favor of a flag. All individual flags are available underneath the `all` subcommand. This required rather more refactoring as the flags had to be known in order to define the command, not just at runtime. Usages are given below: ``` $ oc adm diagnostics --help This utility helps troubleshoot and diagnose known problems for an OpenShift cluster and/or local host. The base command runs a standard set of diagnostics: oc adm diagnostics [...] An individual diagnostic may be run as a subcommand which may have flags for specifying options specific to that diagnostic. Finally, the "all" subcommand runs all available diagnostics (including heavyweight ones skipped in the standard set) and provides all individual diagnostic flags. Usage: oc adm diagnostics [options] Available Commands: aggregatedlogging Check aggregated logging integration for proper configuration all Diagnose common cluster problems [...] unitstatus Check status for related systemd units Options: --cluster-context='': Client context to use for cluster administrator --config='': Path to the config file to use for CLI requests. --context='': The name of the kubeconfig context to use -l, --diaglevel=1: Level of diagnostic output: 4: Error, 3: Warn, 2: Notice, 1: Info, 0: Debug --host=false: If true, look for systemd and journald units even without master/node config --loglevel=0: Set the level of log output (0-10) --logspec='': Set per module logging with file|pattern=LEVEL,... --master-config='': Path to master config file (implies --host) --node-config='': Path to node config file (implies --host) --prevent-modification=false: If true, may be set to prevent diagnostics making any changes via the API ``` (Note `all` is now intermingled with the individual subcommands.) ``` $ oc adm diagnostics all --help This utility helps troubleshoot and diagnose known problems for an OpenShift cluster and/or local host. This subcommand exists to run all available diagnostics: oc adm diagnostics all Available diagnostics vary based on client config and local OpenShift host config. All flags from the base command work similarly here, but all possible flags for individual diagnostics are also available. Usage: oc adm diagnostics all [options] Options: --cluster-context='': Client context to use for cluster administrator --config='': Path to the config file to use for CLI requests. --context='': The name of the kubeconfig context to use -l, --diaglevel=1: Level of diagnostic output: 4: Error, 3: Warn, 2: Notice, 1: Info, 0: Debug --diagnosticpod-images='openshift/origin-${component}:${version}': Image template to use in creating a pod --diagnosticpod-latest-images=false: If true, when expanding the image template, use latest version, not release version --etcdwritevolume-duration='1m': How long to perform the write test --host=false: If true, look for systemd and journald units even without master/node config --loglevel=0: Set the level of log output (0-10) --logspec='': Set per module logging with file|pattern=LEVEL,... --master-config='': Path to master config file (implies --host) --networkcheck-logdir='/tmp/openshift/': Path to store diagnostic results in case of errors --networkcheck-pod-image='openshift/origin:v3.9.0-alpha.0': Image to use for diagnostic pod --networkcheck-test-pod-image='openshift/origin-deployer:v3.9.0-alpha.0': Image to use for diagnostic test pod --networkcheck-test-pod-port=8080: Serving port on the diagnostic test pod --networkcheck-test-pod-protocol='TCP': Protocol used to connect to diagnostic test pod --node-config='': Path to node config file (implies --host) --prevent-modification=false: If true, may be set to prevent diagnostics making any changes via the API ``` ``` $ oc adm diagnostics EtcdWriteVolume --help Runs the EtcdWriteVolume diagnostic. Check the volume of writes against etcd over a time period and classify them by operation and key Aliases: etcdwritevolume, EtcdWriteVolume Usage: oc adm diagnostics etcdwritevolume [options] Options: -l, --diaglevel=1: Level of diagnostic output: 4: Error, 3: Warn, 2: Notice, 1: Info, 0: Debug --duration='1m': How long to perform the write test --host=false: If true, look for systemd and journald units even without master/node config --loglevel=0: Set the level of log output (0-10) --logspec='': Set per module logging with file|pattern=LEVEL,... --master-config='': Path to master config file (implies --host) --node-config='': Path to node config file (implies --host) ``` ``` $ oc adm diagnostics NetworkCheck --help Runs the NetworkCheck diagnostic. Create a pod on all schedulable nodes and run network diagnostics from the application standpoint Aliases: networkcheck, NetworkCheck Usage: oc adm diagnostics networkcheck [options] Options: --cluster-context='': Client context to use for cluster administrator --config='': Path to the config file to use for CLI requests. --context='': The name of the kubeconfig context to use -l, --diaglevel=1: Level of diagnostic output: 4: Error, 3: Warn, 2: Notice, 1: Info, 0: Debug --logdir='/tmp/openshift/': Path to store diagnostic results in case of errors --loglevel=0: Set the level of log output (0-10) --logspec='': Set per module logging with file|pattern=LEVEL,... --pod-image='openshift/origin:v3.9.0-alpha.0': Image to use for diagnostic pod --prevent-modification=false: If true, may be set to prevent diagnostics making any changes via the API --test-pod-image='openshift/origin-deployer:v3.9.0-alpha.0': Image to use for diagnostic test pod --test-pod-port=8080: Serving port on the diagnostic test pod --test-pod-protocol='TCP': Protocol used to connect to diagnostic test pod ```
Resolved with #17773 |
It should be possible for some diagnostics to have optional arguments that parameterize checks that may run too long or too short. Exposed by #14604 and suggested by @eparis. I temporarily used an env var for a variable that only 10-20% of people may need to customize.
The text was updated successfully, but these errors were encountered: