Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1453187

Summary: pod status should be "DeadlineExceeded" instead of "Init:0/1" when initcontainer failed with DeadlineExceeded
Product: OpenShift Container Platform Reporter: Weihua Meng <wmeng>
Component: NodeAssignee: Seth Jennings <sjenning>
Status: CLOSED DUPLICATE QA Contact: DeShuai Ma <dma>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs, decarr, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-22 21:30:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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 ***