Bug 1121238

Summary: OpenShift::Runtime::FrontendProxyServer#system_proxy_delete and #system_proxy_set return incorrect values when provided no arguments
Product: OKD Reporter: Miciah Dashiel Butler Masters <mmasters>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: bmeng, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-10 00:46:10 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:

Description Miciah Dashiel Butler Masters 2014-07-18 17:39:13 UTC
Description of problem:

The system_proxy_delete and system_proxy_set methods of OpenShift::Runtime::FrontendProxyServer each return three values: two IO objects (possibly nil) for stdout and stderr and an integer with the exit status of the oo-iptables-port-proxy command that these methods execute.

However, these three values are returned in inconsistent orderings: Normally, each method returns its values in the aforementioned ordering (stdout, stderr, exit status), but if either of the methods is given no arguments, it returns the values in a different order (exit status, nil, nil):

https://github.com/openshift/origin-server/blob/f838ad7a30cd7c042aa66391b4929d8c56d460db/node/lib/openshift-origin-node/model/frontend_proxy.rb#L227-L229
https://github.com/openshift/origin-server/blob/f838ad7a30cd7c042aa66391b4929d8c56d460db/node/lib/openshift-origin-node/model/frontend_proxy.rb#L253-L255

In addition, the related test cases also have the wrong ordering:

https://github.com/openshift/origin-server/blob/f838ad7a30cd7c042aa66391b4929d8c56d460db/node/test/unit/frontend_proxy_test.rb#L239
https://github.com/openshift/origin-server/blob/f838ad7a30cd7c042aa66391b4929d8c56d460db/node/test/unit/frontend_proxy_test.rb#L261


How reproducible:

No known reproducer, but the code violates its contract.


Actual results:

The return values are ordered inconsistently, depending on the arguments to the methods.


Expected results:

The return values should be ordered consistently, and the tests should reflect this.

Comment 1 Miciah Dashiel Butler Masters 2014-07-18 17:45:04 UTC
PR: https://github.com/openshift/origin-server/pull/5625

Comment 2 openshift-github-bot 2014-07-28 10:31:08 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/36b405cc29c13e56c6baa9327e598ea396b794a0
Fix frontend system_proxy_delete/system_proxy_set

OpenShift::Runtime::FrontendProxyServer#system_proxy_delete and
OpenShift::Runtime::FrontendProxyServer#system_proxy_set: Return values in
a consistent ordering (stdout, stderr, exit status) irrespective of whether
arguments were passed.

Previously, these methods returned the exit status as the first value
instead of the last if no arguments were provided.

Fix the corresponding test cases to expect the correct ordering.

This commit fixes bug 1121238.

Comment 3 Meng Bo 2014-07-29 10:28:47 UTC
Cannot get the stat with missing arguments during system_proxy_set and system_proxy_detele.

Do some regression testing related to the scalable app creation and oo-iptables-port-proxy, no new issue found. 

Move bug to verified.