Bug 1121238 - OpenShift::Runtime::FrontendProxyServer#system_proxy_delete and #system_proxy_set return incorrect values when provided no arguments
Summary: OpenShift::Runtime::FrontendProxyServer#system_proxy_delete and #system_proxy...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-18 17:39 UTC by Miciah Dashiel Butler Masters
Modified: 2015-05-14 23:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-10 00:46:10 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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