Bug 2052034 - Can't start correct debug pod using pod definition yaml in OCP 4.8
Summary: Can't start correct debug pod using pod definition yaml in OCP 4.8
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks: 2068763
TreeView+ depends on / blocked
 
Reported: 2022-02-08 14:35 UTC by Divyam Pateriya
Modified: 2022-08-10 10:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 10:47:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 1062 0 None open Bug 2052034: make sure that we check for resorces and files before picking the simplest path 2022-02-10 14:26:06 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:48:20 UTC

Description Divyam Pateriya 2022-02-08 14:35:19 UTC
Description of problem:

OC Client for Version 4.8 can't start correct debug pod using the pod definition yaml

Version-Release number of selected component (if applicable):
 
# oc version
Client Version: 4.8.13
Server Version: 4.8.13
Kubernetes Version: v1.21.1+a620f50

How reproducible:
100%

Steps to Reproduce:

1. Create a simple pod definition file

~~~
# cat test-pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
  labels:
    app: test-pod
spec:
  containers:
  - command: ["/bin/sh", "-ec", "sleep 300"]
    image: registry.redhat.io/openshift4/ose-cli@sha256:725f4165c9a3327bea15daf342adc6542f308be829e66d3b4d43abd9ad2f9bef
    imagePullPolicy: IfNotPresent
    name: test-container
    resources:
      limits:
        cpu: 500m
        memory: 128Mi
      requests:
        cpu: 250m
        memory: 64Mi
~~~

2. Try to create a debug pod using the below command:

# oc debug -f test-pod.yaml

Starting pod/image-debug ...
Pod IP: 10.131.0.146
If you don't see a command prompt, try pressing enter.
sh-4.4# 


Actual results:

The option "-f" is being ignored and instead a image-debug container is being started

Expected results:

The debug pod should be created using the pod definition yaml file.

Additional info:

Comment 4 zhou ying 2022-02-14 03:58:16 UTC
Checked with latest oc client, the issue has fixed:

[root@localhost roottest]# oc version --client
Client Version: 4.11.0-202202111945.p0.gd7b5d2b.assembly.stream-d7b5d2b

[root@localhost roottest]# oc debug -f /tmp/test-pod.yaml 
Starting pod/test-pod-debug, command was: /bin/sh -ec sleep 300
Pod IP: 10.128.2.31
If you don't see a command prompt, try pressing enter.
sh-4.4#


[root@localhost ~]# oc get events
LAST SEEN   TYPE     REASON           OBJECT               MESSAGE
64s         Normal   Scheduled        pod/test-pod-debug   Successfully assigned zhouyt/test-pod-debug to ip-10-0-58-4.us-east-2.compute.internal
63s         Normal   AddedInterface   pod/test-pod-debug   Add eth0 [10.128.2.31/23] from openshift-sdn
63s         Normal   Pulling          pod/test-pod-debug   Pulling image "registry.redhat.io/openshift4/ose-cli@sha256:725f4165c9a3327bea15daf342adc6542f308be829e66d3b4d43abd9ad2f9bef"
55s         Normal   Pulled           pod/test-pod-debug   Successfully pulled image "registry.redhat.io/openshift4/ose-cli@sha256:725f4165c9a3327bea15daf342adc6542f308be829e66d3b4d43abd9ad2f9bef" in 7.60403777s
55s         Normal   Created          pod/test-pod-debug   Created container test-container
55s         Normal   Started          pod/test-pod-debug   Started container test-container
[root@localhost ~]# oc get po
NAME             READY   STATUS    RESTARTS   AGE
test-pod-debug   1/1     Running   0          74s

Comment 8 errata-xmlrpc 2022-08-10 10:47:58 UTC
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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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.

https://access.redhat.com/errata/RHSA-2022:5069


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