Bug 1330050

Summary: Output info is not correct when debug a pod with invalid node name.
Product: OpenShift Container Platform Reporter: Yanping Zhang <yanpzhan>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED ERRATA QA Contact: Wei Sun <wsun>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.0CC: aos-bugs, ffranz, jokerman, mmccomas, tdawson, trankin
Target Milestone: ---Keywords: Regression
Target Release: 3.2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1345805 (view as bug list) Environment:
Last Closed: 2016-05-12 16:36:26 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:
Bug Depends On:    
Bug Blocks: 1345805    

Description Yanping Zhang 2016-04-25 10:52:44 UTC
Description of problem:
When debug a pod with option --node-name, set an invalid node name, it prompts error info, but the info is not correct.

Version-Release number of selected component (if applicable):
oc v1.2.0-rc1-17-g642f0af
openshift v1.2.0-rc1-17-g642f0af
kubernetes v1.2.0-36-g4a3f9c5

How reproducible:
Always

Steps to Reproduce:
1.Create pod using dc file.
$ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/deployment/dc-with-two-containers.yaml
2.Debug with invalid node name:
$ oc debug dc/dctest  --node-name=invalidnode -- /bin/env
3.

Actual results:
2.It prompts info about pods not found:
$ oc debug dc/dctest  --node-name=invalidnode -- /bin/env
Debugging with pod/dctest-debug, original command: <image entrypoint>
Waiting for pod to start ...

Removing debug pod ...
error: unable to delete the debug pod "dctest-debug": pods "dctest-debug" not foundError from server: pods "dctest-debug" not found


Expected results:
2.Should prompt info that the node "invalidnode" not found, but not the info that pod not found.

Additional info:
If `oc get pod --watch` in another terminal, pod "dctest-debug" is watched though.

Comment 1 Fabiano Franz 2016-04-25 19:13:36 UTC
We don't validate --node-name client-side, we just set pod.Spec.NodeName and rely on the API validation instead. 

It seems that until v1.1.4 the pod creation would error out right away with "nodes <node name> not found" in case of an invalid pod.Spec.NodeName, and starting with v1.1.5 the pod gets scheduled and errors later, async to the API call. So likely related to a rebase prior to that version. Probably related: https://github.com/kubernetes/kubernetes/commit/496fc3c7eda5c21d67c17fc2dcf9d3ec847f3c26#diff-2f2856ed0f6487c4906b43ac137117c3L40.

Andy, can you confirm?

Comment 2 Fabiano Franz 2016-04-25 22:50:24 UTC
We are going to do client-side validation.

Comment 3 Fabiano Franz 2016-04-27 13:39:42 UTC
Fixed in https://github.com/openshift/origin/pull/8628.

Comment 4 Yanping Zhang 2016-04-28 03:30:41 UTC
Tested on devenv-fedora_4053

$ oc version
oc v1.3.0-alpha.0-167-g4589987
kubernetes v1.3.0-alpha.1-331-g0522e63

$ oc debug -n prozyp dc/testpod --node-name=invalidnode -- /bin/env 
Debugging with pod/testpod-debug, original command: <image entrypoint>
Waiting for pod to start ...

Removing debug pod ...
error: unable to create the debug pod "testpod-debug" on node "invalidnode"

Now the output has been updated with correct info, so move the bug to Verified.

Comment 6 errata-xmlrpc 2016-05-12 16:36:26 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, 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-2016:1064