[jbosstools-issues] [JBoss JIRA] (JBIDE-23463) Properties: Build pod has state of exit code 0 instead of correct status completed

Viacheslav Kabanovich (JIRA) issues at jboss.org
Tue Nov 8 13:43:00 EST 2016


    [ https://issues.jboss.org/browse/JBIDE-23463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13319073#comment-13319073 ] 

Viacheslav Kabanovich edited comment on JBIDE-23463 at 11/8/16 1:42 PM:
------------------------------------------------------------------------

Method com.openshift.internal.restclient.model.Pod.getStatus() declares in javadoc that "The logic of the method is a copied from 'podStatus' function of [app/scripts/filters/resources.js] of [openshift/origin-web-console]".
However, it is not exactly so.
In resources.js, first 'state.terminated.reason' is checked, and if not empty, returned. Only otherwise 'signal' and 'exitCode' are checked, in that order.
In Pod, container states ids are put into HashMap POD_STATUS_CONTAINER_STATES and Pod.getContainerStatusStringIfExist() iterates over them. But HashMap does not save the order of keys.
Then, one simple solution is to replace HashMap with List<String[]> where String[] has 2 elements, [0] - id, [1] - value (human-friendly label).


was (Author: scabanovich):
Method com.openshift.internal.restclient.model.Pod.getStatus() declares in javadoc that "The logic of the method is a copied from 'podStatus' function of [app/scripts/filters/resources.js] of [openshift/origin-web-console]".
However, it is not exactly so.
In resources.js, first 'state.terminated.reason' is checked, and if not empty, returned. Only otherwise 'signal' and 'exitCode' are checked, in that order.
In Pod, container states ids are put into HashMap POD_STATUS_CONTAINER_STATES and Pod.getContainerStatusStringIfExist() iterates over them. But HashMap does not save the order of keys.
Then, one simple solution is to replace HashMap with List<String[]> where String[] has 2 elements, [0] - id, [1] - value.

> Properties: Build pod has state of exit code 0 instead of correct status completed
> ----------------------------------------------------------------------------------
>
>                 Key: JBIDE-23463
>                 URL: https://issues.jboss.org/browse/JBIDE-23463
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 4.4.2.AM3
>            Reporter: Marián Labuda
>              Labels: openshift_v3
>             Fix For: 4.4.x
>
>         Attachments: exit-code-0.png
>
>
> When I create a new OpenShift 3 application from a template, there is a running build. Once a build pod is completed, it has status "Completed". But now it Pods tabbed properties it contains status "Exit Code: 0" which is not user friendly and it broke integration tests.
> steps:
> # EXEC: create an application via a s2i template
> # EXEC: in OpenShift explorer: select the connection that you used to create the application and open up the "Properties view"
> # EXEC: in Properties: select "Pods" tab.
> # ASSERT: a build pod is appearing
> # EXEC: wait until the build pod is terminated and then look at its "Status" in the Properties > Pods
> Result:
> The status for the pod is reported with a "Exit Code: 0" (if successfully terminated, "Exit Code: 1" otherwise)
> !exit-code-0.png!



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)



More information about the jbosstools-issues mailing list