Bug 872415 - No config setting for default gear capabilities for a new user
Summary: No config setting for default gear capabilities for a new user
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 1.2.0
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 885097
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-02 02:55 UTC by Luke Meyer
Modified: 2017-03-08 17:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-31 20:32:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0220 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 1.1 update 2013-02-01 01:23:24 UTC

Description Luke Meyer 2012-11-02 02:55:51 UTC
Description of problem:
What I'm looking for is that as an admin, I can define the default gear profiles available to a user when they first log in (which is when they're created in mongo in OSE). In OSE they could have dozens of gear profiles available, and only want the user to get a few by default.

I don't think there is actually a broker.conf key for this. It looks like currently when a user is created, they get :default_gear_size as their capability:

./controller/lib/openshift-origin-controller/app/models/cloud_user.rb:    self.capabilities['gear_sizes'] = [Rails.application.config.openshift[:default_gear_size]] unless self.capabilities.has_key?('gear_sizes')

But that's not what that key is for; it's for choosing a gear size at app create time when the user didn't specify one. Just happens to work out on hosted.

There's also a :gear_sizes key which maps from VALID_GEAR_SIZES. Using that would default each user to have access to all gear profiles, probably not what we want.


Additional info:

Going to add :default_gear_capabilities and use that.

Comment 1 Luke Meyer 2012-11-02 03:02:06 UTC
The fix is pretty simple.
https://github.com/openshift/origin-server/pull/804

The problem is getting the tests to pass. Thing is, in a devenv, o-o-broker is replaced by rhc-broker, which comes out of li and has its own broker.conf and production.rb. If that value isn't set at least to the default in production.rb, then the code in the above pull fails (it's not expecting nil).

So I need this to go in first (it just sets the conf value, doesn't use it):

https://github.com/openshift/li/pull/562

I ran all tests against a devenv with both these changes and all passed. I don't know how else to convince Jenkins that these pulls are safe.

Comment 2 Luke Meyer 2012-11-02 16:45:08 UTC
As no one is going to need this on day 1 of the release, and I don't want to get bogged down in cross-repo cross-project problems, we will ship it as-is and plan to fix this as an errata.

Comment 3 Brenton Leanhardt 2012-11-06 12:50:27 UTC
per Comment #2 I'm lowering the priority/severity.

Comment 5 Luke Meyer 2012-12-11 14:08:29 UTC
Merged upstream and verified.

Fix in OSE is https://github.com/openshift/enterprise-server/pull/6

Comment 6 Johnny Liu 2012-12-12 10:13:16 UTC
Verified this bug with 1.1.x/2012-12-11.3  puddle, and PASS.

Steps:
1). On node, modify /etc/openshift/resource_limits.conf
node_profile=b4

2). On broker, modify the following line in /etc/openshift/broker.conf.
DEFAULT_GEAR_CAPABILITIES="small,b4"

3). Restart openshift-broker service. 

4). Create domain

5). Run the following command to check user's capabilities
#  oo-admin-ctl-user -l xx3 (on broker)
User xx3:
      consumed gears: 0
           max gears: 100
          gear sizes: small, b4

$ curl -k -X GET -H 'Accept: application/xml' --user xx3:redhat https://broker.example.com/broker/rest/user (on client)

6).Fail to create app with default gear size (small).

7). Create a "b4" gear app successfully
$ rhc app create -a app1 -t php-5.3 -g b4

Comment 8 errata-xmlrpc 2013-01-31 20:32:01 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.

http://rhn.redhat.com/errata/RHSA-2013-0220.html


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