Bug 997848 - Sub-account cannot inherit gear size from parent account
Sub-account cannot inherit gear size from parent account
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-16 05:45 EDT by Meng Bo
Modified: 2015-05-14 20:20 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-29 08:52:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2013-08-16 05:45:04 EDT
Description of problem:
Make my account allow subaccount and can inherit gear size, add some gear size to my account. Create subaccount of this account.

#oo-admin-ctl-user -l bmeng@redhat.com --allowsubaccount true --inheritgearsizes true --addgearsize c9 --addgearsize medium

Check the attribute of the subaccount. Only small gear is allowed for the subaccount.

Version-Release number of selected component (if applicable):
devenv_3660

How reproducible:
always

Steps to Reproduce:
1.Make my account allow subaccount and can inherit gear size and add gear size for it
#oo-admin-ctl-user -l bmeng@redhat.com --allowsubaccount true --inheritgearsizes true --addgearsize c9 --addgearsize medium
2.Create subaccount via rest api
#curl -k -H 'Accept: application/xml' -H "X-Impersonate-User: bmeng+sub1@redhat.com" --user bmeng@redhat.com:xxx https://localhost/broker/rest/user
3.Check the attribute of sub-account bmeng+sub1@redhat.com


Actual results:
Only small size is allowed for the subaccount.
      <id>520df052abfea4bb4100004f</id>
      <login>bmeng+sub1@redhat.com</login>
      <consumed-gears>0</consumed-gears>
      <plan-id>free</plan-id>
      <plan-state>ACTIVE</plan-state>
      <usage-account-id nil="true"></usage-account-id>
      <created-at>2013-08-16T09:26:42Z</created-at>
      <capabilities>
        <subaccounts>false</subaccounts>
        <gear-sizes>
          <gear-size>small</gear-size>
        </gear-sizes>
        <plan-upgrade-enabled>true</plan-upgrade-enabled>
      </capabilities>
      <max-gears>3</max-gears>


Expected results:
Subaccount should inherit gear sizes from parent account.

Additional info:
parent account info:

      <id>520deb8fabfea4da26000001</id>
      <login>bmeng@redhat.com</login>
      <consumed-gears>3</consumed-gears>
      <plan-id>silver</plan-id>
      <plan-state>ACTIVE</plan-state>
      <usage-account-id>1728373</usage-account-id>
      <created-at>2013-08-16T09:06:23Z</created-at>
      <capabilities>
        <plan-upgrade-enabled>true</plan-upgrade-enabled>
        <subaccounts>true</subaccounts>
        <gear-sizes>
          <gear-size>small</gear-size>
          <gear-size>medium</gear-size>
          <gear-size>c9</gear-size>
        </gear-sizes>
        <private-ssl-certificates>true</private-ssl-certificates>
        <inherit-on-subaccounts>
          <inherit-on-subaccount>gear_sizes</inherit-on-subaccount>
        </inherit-on-subaccounts>
        <max-storage-per-gear>5</max-storage-per-gear>
      </capabilities>
      <max-gears>16</max-gears>
Comment 1 Clayton Coleman 2013-08-16 13:10:23 EDT
Capabilities are right (at the broker level), it's only the rest API that is broken.
Comment 2 Clayton Coleman 2013-08-20 11:37:57 EDT
Fixed in https://github.com/openshift/origin-server/pull/3435
Comment 3 openshift-github-bot 2013-08-20 14:15:47 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/957a6daa1774072ced6afc845c38632247ceb166
Bug 997848 - Inherited capabilities not in REST API

With the changes to use CapabilityProxy, the default API serialization (Rails) was serializing the user's underlying attribute from Mongoid, not the proxy overlay of inherited capabilities.  Changed to use serializable_hash which uses the proper values
Comment 4 Meng Bo 2013-08-21 06:57:15 EDT
Teston devenv_3680, the subaccount can inherit the gear size from parent account now.

    <user>
      <id>52149cb79e7126b70b000096</id>
      <login>bmengsub@redhat.com</login>
      <consumed-gears>0</consumed-gears>
      <plan-id>free</plan-id>
      <plan-state>ACTIVE</plan-state>
      <usage-account-id nil="true"></usage-account-id>
      <created-at>2013-08-21T10:55:51Z</created-at>
      <capabilities>
        <subaccounts>false</subaccounts>
        <gear-sizes>
          <gear-size>small</gear-size>
          <gear-size>c9</gear-size>
        </gear-sizes>
        <plan-upgrade-enabled>true</plan-upgrade-enabled>
      </capabilities>
      <max-gears>3</max-gears>
    </user>

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