mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-17 15:05:10 +00:00
The container status waiting reason toggles between `ImagePullBackOff`
and the actual pull error, resulting in a bad user experience for
consumers like kubectl. For example, the output of
`kubectl get pods` does return either:
```
NAME READY STATUS RESTARTS AGE
pod 0/1 SignatureValidationFailed 0 10s
```
or
```
NAME READY STATUS RESTARTS AGE
pod 0/1 ImagePullBackOff 0 18s
```
depending in which state the image pull is. We now improve that behavior
by preserving the actual error in the `message` of the `waiting` state
from the pull during back-off:
```json
{
"waiting": {
"message": "Back-off pulling image \"quay.io/crio/unsigned:latest\": SignatureValidationFailed: image pull failed for quay.io/crio/unsigned:latest because the signature validation failed: Source
image rejected: A signature was required, but no signature exists",
"reason": "ImagePullBackOff"
}
}
```
While the `SignatureValidationFailed` value inherits from the previous
known state:
```json
{
"waiting": {
"message": "image pull failed for quay.io/crio/unsigned:latest because the signature validation failed: Source image rejected: A signature was required, but no signature exists",
"reason": "SignatureValidationFailed"
}
}
```
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>