You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`--all-namespaces`, `-A` | `false` | If present, tail across all namespaces. A specific namespace is ignored even if specified with --namespace.
75
-
`--color` | `auto` | Force set color output. 'auto': colorize if tty attached, 'always': always colorize, 'never': never colorize.
76
-
`--completion` | | Output stern command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.
77
-
`--container`, `-c` | `.*` | Container name when multiple containers in pod. (regular expression)
78
-
`--container-state` | `all` | Tail containers with state in running, waiting, terminated, or all. 'all' matches all container states. To specify multiple states, repeat this or set comma-separated value.
79
-
`--context` | | Kubernetes context to use. Default to current context configured in kubeconfig.
80
-
`--ephemeral-containers` | `true` | Include or exclude ephemeral containers.
`--init-containers` | `true` | Include or exclude init containers.
87
-
`--kubeconfig` | | Path to kubeconfig file to use. Default to KUBECONFIG variable then ~/.kube/config path.
88
-
`--max-log-requests` | `-1` | Maximum number of concurrent logs to request. Defaults to 50, but 5 when specifying --no-follow
89
-
`--namespace`, `-n` | | Kubernetes namespace to use. Default to namespace configured in kubernetes context. To specify multiple namespaces, repeat this or set comma-separated value.
90
-
`--no-follow` | `false` | Exit when all logs have been shown.
91
-
`--node` | | Node name to filter on.
92
-
`--only-log-lines` | `false` | Print only log lines
`--all-namespaces`, `-A` | `false` | If present, tail across all namespaces. A specific namespace is ignored even if specified with --namespace.
75
+
`--color` | `auto` | Force set color output. 'auto': colorize if tty attached, 'always': always colorize, 'never': never colorize.
76
+
`--completion` | | Output stern command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.
77
+
`--config` | `~/.config/stern/config.yaml` | Path to the stern config file
78
+
`--container`, `-c` | `.*` | Container name when multiple containers in pod. (regular expression)
79
+
`--container-state` | `all` | Tail containers with state in running, waiting, terminated, or all. 'all' matches all container states. To specify multiple states, repeat this or set comma-separated value.
80
+
`--context` | | Kubernetes context to use. Default to current context configured in kubeconfig.
81
+
`--ephemeral-containers` | `true` | Include or exclude ephemeral containers.
`--init-containers` | `true` | Include or exclude init containers.
88
+
`--kubeconfig` | | Path to kubeconfig file to use. Default to KUBECONFIG variable then ~/.kube/config path.
89
+
`--max-log-requests` | `-1` | Maximum number of concurrent logs to request. Defaults to 50, but 5 when specifying --no-follow
90
+
`--namespace`, `-n` | | Kubernetes namespace to use. Default to namespace configured in kubernetes context. To specify multiple namespaces, repeat this or set comma-separated value.
91
+
`--no-follow` | `false` | Exit when all logs have been shown.
92
+
`--node` | | Node name to filter on.
93
+
`--only-log-lines` | `false` | Print only log lines
returnfmt.Errorf("invalid value %q for %q in the config file: %v", value, name, err)
345
+
}
346
+
}
347
+
348
+
returnnil
349
+
}
350
+
292
351
// AddFlags adds all the flags used by stern.
293
352
func (o*options) AddFlags(fs*pflag.FlagSet) {
294
353
fs.BoolVarP(&o.allNamespaces, "all-namespaces", "A", o.allNamespaces, "If present, tail across all namespaces. A specific namespace is ignored even if specified with --namespace.")
@@ -321,6 +380,7 @@ func (o *options) AddFlags(fs *pflag.FlagSet) {
321
380
fs.StringVarP(&o.timestamps, "timestamps", "t", o.timestamps, "Print timestamps with the specified format. One of 'default' or 'short'. If specified but without value, 'default' is used.")
322
381
fs.StringVar(&o.timezone, "timezone", o.timezone, "Set timestamps to specific timezone.")
323
382
fs.BoolVar(&o.onlyLogLines, "only-log-lines", o.onlyLogLines, "Print only log lines")
383
+
fs.StringVar(&o.configFilePath, "config", o.configFilePath, "Path to the stern config file")
324
384
fs.IntVar(&o.verbosity, "verbosity", o.verbosity, "Number of the log level verbosity")
325
385
fs.BoolVarP(&o.version, "version", "v", o.version, "Print the version and exit.")
0 commit comments