kubernetes / kubernetes/kubectl

Forcing `kubectl log` to wait when container is creating

Open
#1,227 21 comments 33 reactions 1 assignee Claimed by @ankritisachan View on GitHub
kind/feature lifecycle/rotten needs-triage
Dominant language
Go
Stars
3.3k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

**What would you like to be added**:

When we do `kubectl logs [-f]` on a container in creation, we get this error message:
```
Error from server (BadRequest): container "" in pod "" is waiting to start: [ContainerCreating, PodInitializing]
```
In this situation, in general we retry to launch the `kubectl logs [-f]` until the container is created.

A nice feature would be to have a the `kubectl logs` command to block until the container is created, so we run this command only one time.

**Why is this needed**:
To simplify the life of the user.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.