Bug 1453187 - pod status should be "DeadlineExceeded" instead of "Init:0/1" when initcontainer failed with DeadlineExceeded
Summary: pod status should be "DeadlineExceeded" instead of "Init:0/1" when initcontai...
Keywords:
Status: CLOSED DUPLICATE of bug 1453180
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Seth Jennings
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-22 10:57 UTC by Weihua Meng
Modified: 2017-05-22 21:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-22 21:30:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Weihua Meng 2017-05-22 10:57:07 UTC
Description of problem:
pod status should be "DeadlineExceeded" instead of "Init:0/1" when initcontainer failed with DeadlineExceeded

Version-Release number of selected component (if applicable):
openshift v3.6.77
kubernetes v1.6.1+5115d708d7

How reproducible:
Always

Steps to Reproduce:
1. create a pod having active-deadline with initcontainer.
# cat pod-init-containers-deadline.yaml
apiVersion: v1
kind: Pod
metadata:
  name: init-deadline
spec:
  containers:
  - name: nginx
    image: nginx
    ports:
    - containerPort: 80
    volumeMounts:
    - name: workdir
      mountPath: /usr/share/nginx/html
  initContainers:
  - name: init
    image: centos:centos7
    command:
    - /bin/sh
    - "-c"
    - "sleep 30"
  activeDeadlineSeconds: 15
  volumes:
  - name: workdir
    emptyDir: {}

2. check the pod status before and after DeadlineExceeded
$ oc get pod

Actual results:
$ oc get pod
NAME            READY     STATUS     RESTARTS   AGE
init-deadline   0/1       Init:0/1   0          8s

# oc get pod
NAME            READY     STATUS     RESTARTS   AGE
init-deadline   0/1       Init:0/1   0          54s


Expected results:
since at time 8s, pod is running/pending, 
at time 54s, pod is failed,
I would expect user can get the difference  by pod status 
$ oc get pod
NAME            READY     STATUS     RESTARTS   AGE
init-deadline   0/1       Init:0/1   0          8s

# oc get pod
NAME            READY     STATUS             RESTARTS   AGE
init-deadline   0/1       DeadlineExceeded   0          54s
Additional info:

Comment 1 Seth Jennings 2017-05-22 21:30:18 UTC
The expected output is "Init:DeadlineExceeded"

https://github.com/kubernetes/kubernetes/blob/master/pkg/printers/internalversion/printers.go#L276

The printer is correct but the init container state is not correct as reported in BZ1453180

*** This bug has been marked as a duplicate of bug 1453180 ***


Note You need to log in before you can comment on or make changes to this bug.