oc debug acts to create a pod that represents a testable scenario on the cluster with a shell for debugging. The most primitive scenario is oc debug with no arguments, or with --image=X, which allows a user to debug the simplest possible scenario. The default images (the tools image) should be usable.
This is still in the queue so bumping it to 4.8, we'll reconsider backport.
Verified the bug on 4.8 ci payload and i see that oc debug works fine where as i see that keeplabels not working, will test these on nightly builds before moving the bug to verified state.
Verified with the payload below and i see that ./oc debug with out any image works fine, but running ./oc debug dc/postgresql --keep-labels=true gives error as below. [knarra@knarra openshift-client-linux-4.8.0-0.nightly-2021-02-21-102854]$ ./oc debug dc/postgresql --keep-labels=true Starting pod/postgresql-debug, command was: container-entrypoint run-postgresql Removing debug pod ... error: unable to create the debug pod "postgresql-debug" Below are the steps performed to test the --keep-labels command: =============================================================== 1) ./oc new-project knarra 2) ./oc new-app rails-postgresql-example 3) ./oc debug dc/postgresql works fine 4) But running ./oc debug dc/postgresql --keep-labels=true fails with error as below [knarra@knarra openshift-client-linux-4.8.0-0.nightly-2021-02-21-102854]$ ./oc debug dc/postgresql --keep-labels=true Starting pod/postgresql-debug, command was: container-entrypoint run-postgresql Removing debug pod ... error: unable to create the debug pod "postgresql-debug" Based on the above moving bug to assigned state. [knarra@knarra openshift-client-linux-4.8.0-0.nightly-2021-02-21-102854]$ ./oc version -o yaml clientVersion: buildDate: "2021-02-20T04:51:51Z" compiler: gc gitCommit: 13f3e4b73df9b0853979e4130adf756784afe96f gitTreeState: clean gitVersion: 4.8.0-202102200123.p0-13f3e4b goVersion: go1.15.5 major: "" minor: "" platform: linux/amd64 openshiftVersion: 4.8.0-0.nightly-2021-02-21-102854 releaseClientVersion: 4.8.0-0.nightly-2021-02-21-102854 serverVersion: buildDate: "2021-02-19T22:50:50Z" compiler: gc gitCommit: 01ab7fd5278756572d4a1dd3101f0a6d5c969824 gitTreeState: clean gitVersion: v1.20.0+01ab7fd goVersion: go1.15.5 major: "1" minor: "20" platform: linux/amd64 Below is the output running with -v=9: ========================================= http://pastebin.test.redhat.com/941668
Created attachment 1758662 [details] 5m CPU profile during e2e execution
Created attachment 1758663 [details] 5m CPU profile during e2e execution (later)
Oops, attachments are for the wrong bug
(In reply to RamaKasturi from comment #4) > [knarra@knarra openshift-client-linux-4.8.0-0.nightly-2021-02-21-102854]$ > ./oc debug dc/postgresql --keep-labels=true > Starting pod/postgresql-debug, command was: container-entrypoint > run-postgresql > > Removing debug pod ... > error: unable to create the debug pod "postgresql-debug" This will be expected situation, because when you copy pod's labels into the exact same namespace that pod will be automatically considered by owning controller, here replication controller as one of the pods and since the replicas is set to 1 and it sees more than 1 pod, it removes the youngest one immediately. Given that, I'm moving this back to qa.
Tried to verify the bug by following the steps below but hit issue below, so moving the bug back to assigned state The Pod "postgresql-debug" is invalid: spec.containers[0].image: Invalid value: " ": must not have leading or trailing whitespace Steps performed: ================ 1) Install 4.8 cluster 2) ./oc new-project test 3) ./oc new-app rails-postgresql-example [knarra@knarra openshift-client-linux-4.8.0-0.nightly-2021-06-11-024306]$ ./oc debug dc/postgresql The Pod "postgresql-debug" is invalid: spec.containers[0].image: Invalid value: " ": must not have leading or trailing whitespace
I think, image debugging has already been verified; $ oc debug should create a debug pod with the image openshift/tools $ oc debug --image=nginx should create a debug pod with the image nginx This bug is still open because of errors `oc debug dc/postgresql`. I tried to reproduce this issue and the problem seems to be fixed in newer versions; Steps performed: ================ 1) Install 4.12 cluster 2) ./oc new-project test 3) ./oc new-app rails-postgresql-example 4) privilige test namespace with correct labels 5) ./oc debug dc/postgresql If you don't see a command prompt, try pressing enter. sh-4.4$ I'm moving this bug to ON_QA.
according https://bugzilla.redhat.com/show_bug.cgi?id=1920024#c8, will move to verified status .