Sometime in last few releases init containers stopped being debuggable with `oc debug pod/foo -c <init_container_name>`. The root cause is the wait logic for the pod container to be running ignores init containers.
The fix is to adjust the wait logic to correctly read init containers. Also, I simplified and removed some logic that was subject to exiting early on errors that might be transient (for instance, the first image pull can fail and the second can succeed) and replaced those with warning messages.
May need a backport for 4.6.
Sounds like this is a regression but not a new one. Moving to blocker- to denote that we won't block the release on this.
Confirmed with latest oc client, can't reproduce the issue now:
[root@dhcp-140-138 ~]# oc version --client -o yaml
[root@dhcp-140-138 ~]# oc debug po/openshift-kube-scheduler-ip-1xxxx.compute.internal -c wait-for-host-port
If you don't see a command prompt, try pressing enter.
Removing debug pod ...
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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.