+++ This bug was initially created as a clone of Bug #1779331 +++ Init containers were not fully supported in oc debug. We need to fix that, and also ensure that specific debug options work well with DaemonSet pods.
Confirmed with the latest oc client, the issue has fixed: [root@dhcp-140-138 ~]# oc version -oyaml clientVersion: buildDate: "2019-12-06T11:24:15Z" compiler: gc gitCommit: 3fa38ed2761a75d4c648acfc8ac14df930219ed5 gitTreeState: clean gitVersion: v4.3.0 goVersion: go1.12.12 major: "" minor: "" platform: linux/amd64 [root@dhcp-140-138 ~]# oc debug po/myapp-pod -n zhouy -c init-mydb --keep-init-containers=false Starting pod/myapp-pod-debug, command was: sh -c until nslookup mydb; do echo waiting for mydb; sleep 2; done; Pod IP: 10.128.2.19 If you don't see a command prompt, try pressing enter. / # [root@dhcp-140-138 ~]# oc describe po/myapp-pod-debug -n zhouy Name: myapp-pod-debug Namespace: zhouy Priority: 0 Node: ip-10-0-138-96.us-east-2.compute.internal/10.0.138.96 Start Time: Wed, 11 Dec 2019 21:26:42 +0800 Labels: <none> Annotations: debug.openshift.io/source-container: init-mydb debug.openshift.io/source-resource: /v1, Resource=pods/myapp-pod k8s.v1.cni.cncf.io/networks-status: [{ "name": "openshift-sdn", "interface": "eth0", "ips": [ "10.128.2.19" ], "dns": {}, "default-route": [ "10.128.2.1" ] }] openshift.io/scc: anyuid Status: Pending IP: 10.128.2.19 IPs: IP: 10.128.2.19 Init Containers: init-mydb: ...... Containers: myapp-container: ...... myapp-container2: Container ID: Image: openshift/origin ...... [root@dhcp-140-138 ~]# oc debug -h Launch a command shell to debug a running application .... --to-namespace='': Override the namespace to create the pod into (instead of using --namespace).
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:0062