Bug 1025451 - Carts installed as vendored RPM's with non redhat vendor names can't create jenkins builders
Carts installed as vendored RPM's with non redhat vendor names can't create j...
Product: OpenShift Online
Classification: Red Hat
Component: Image (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Dan Mace
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-10-31 14:07 EDT by Clayton Coleman
Modified: 2015-05-14 20:34 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-23 22:28:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Clayton Coleman 2013-10-31 14:07:54 EDT

1) Create and install an RPM web framework cartridge onto the system using a different "vendor" value in the manifest.
2) Create an application based on that - add the jenkins client

Jenkins builder_type in build job should be "paypal-go-1.1"

Jenkins builder_type in build job is "go-1.1"

Jenkins build gets a builder_type set that doesn't have the vendor attribute in it - so "go-1.1" instead of "paypal-go-1.1".  The REST API rejects go-1.1 as a valid cartridge name because you must specify a vendor for non redhat carts.  The builder_type is set by bash/sdk function primary_cartridge_name() which looks at OPENSHIFT_*_IDENT and takes the second and third elements.


No one else uses primary_cartridge_name() any more - we probably should change the meaning of the API function to "return the cartridge name that the rest api accepts".  Since the REST API treats non vendored cart names as "redhat-", we can also send "redhat-mysql-5.1" to the REST API.  So we should be able to change primary_cartridge_name to return $1-$2-$3 instead of $2-$3.

Tested and verified this change:

function primary_cartridge_name() {
  awk -F: '{printf "%s-%s-%s", $1, $2, $3}' $OPENSHIFT_PRIMARY_CARTRIDGE_DIR/env/OPENSHIFT_*_IDENT

Did not implement change
Comment 1 Dan Mace 2013-11-07 09:30:12 EST
We won't be able to implement this capability without some changes to the OpenShift Java API; it currently doesn't have any notion of cartridge vendors, so there's no way to obtain references to non-redhat cartridges, nor is there a way to add such cartridges to applications via the API.

Marking this UpcomingRelease again while I work with Andre on enhancing the Java API.
Comment 2 Dan Mace 2013-11-07 10:10:12 EST
Further investigation has revealed the the current Java API might actually accommodate this if the REST API is behaving as expected in terms of cartridge listings. Reassigning to the release.
Comment 3 Dan Mace 2013-11-07 14:43:29 EST
Identified some blocking bugs that will require this fix to be deferred.
Comment 4 Dan Mace 2013-11-07 16:49:34 EST
Found a workaround that makes the fix blocked only on 1028154, which is achievable this release after all.
Comment 5 openshift-github-bot 2013-11-08 11:59:43 EST
Commit pushed to master at https://github.com/openshift/origin-server

Bug 1025451: Include cartridge vendor in sdk cart ident function

Include the cartridge vendor when constructing a cartridge name/identifier from
the `primary_cartridge_name` function. This disambiguates cartridges provided by
other vendors (e.g. for builder cartridges such as Jenkins which will use the
identifier to construct new gears).
Comment 6 Dan Mace 2013-11-08 15:55:24 EST
Removing the block on bug 1028154.
Comment 7 Yan Du 2013-11-11 06:25:02 EST
test on devenv 4016

1. install a new cartridge using a different "vendor" value in the manifest.
2. create an app with the cartridge installed 
3. add jenkins client to the app
4. make some change for jenkins build
After jenkins build, check the jenkins console, builder type is shown with vendor attribute.

move to verified.

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