Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 872415 - No config setting for default gear capabilities for a new user
No config setting for default gear capabilities for a new user
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
1.2.0
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Luke Meyer
libra bugs
: Triaged
Depends On: 885097
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-01 22:55 EDT by Luke Meyer
Modified: 2017-03-08 12 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-31 15:32:01 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0220 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 1.1 update 2013-01-31 20:23:24 EST

  None (edit)
Description Luke Meyer 2012-11-01 22:55:51 EDT
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-01 23:02:06 EDT
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 12:45:08 EDT
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 07:50:27 EST
per Comment #2 I'm lowering the priority/severity.
Comment 5 Luke Meyer 2012-12-11 09:08:29 EST
Merged upstream and verified.

Fix in OSE is https://github.com/openshift/enterprise-server/pull/6
Comment 6 Johnny Liu 2012-12-12 05:13:16 EST
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 15:32:01 EST
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.