Skip to content

Commit 2502c91

Browse files
author
Takashi Kusumi
authored
Change the default of --container-state to all (#225)
1 parent 9fbaa18 commit 2502c91

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Supported Kubernetes resources are `pod`, `replicationcontroller`, `service`, `d
7575
`--color` | `auto` | Force set color output. 'auto': colorize if tty attached, 'always': always colorize, 'never': never colorize.
7676
`--completion` | | Output stern command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.
7777
`--container`, `-c` | `.*` | Container name when multiple containers in pod. (regular expression)
78-
`--container-state` | `running` | 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.
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.
7979
`--context` | | Kubernetes context to use. Default to current context configured in kubeconfig.
8080
`--ephemeral-containers` | `true` | Include or exclude ephemeral containers.
8181
`--exclude`, `-e` | `[]` | Log lines to exclude. (regular expression)

cmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func NewOptions(streams genericclioptions.IOStreams) *options {
7979

8080
color: "auto",
8181
container: ".*",
82-
containerStates: []string{"running"},
82+
containerStates: []string{stern.ALL_STATES},
8383
initContainers: true,
8484
ephemeralContainers: true,
8585
output: "default",

stern/container_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func NewContainerState(stateConfig string) (ContainerState, error) {
4141
return ALL_STATES, nil
4242
}
4343

44-
return "", errors.New("containerState should be one of 'running', 'waiting', or 'terminated'")
44+
return "", errors.New("containerState should be one of 'running', 'waiting', 'terminated', or 'all'")
4545
}
4646

4747
// Match returns ContainerState is matched

0 commit comments

Comments
 (0)