Bug 1025451 - Carts installed as vendored RPM's with non redhat vendor names can't create jenkins builders
Summary: Carts installed as vendored RPM's with non redhat vendor names can't create j...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Dan Mace
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-31 18:07 UTC by Clayton Coleman
Modified: 2015-05-15 00:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-24 03:28:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Clayton Coleman 2013-10-31 18:07:54 UTC
Reproduce:

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

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

Actual:
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.

Fix:

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 14:30:12 UTC
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 15:10:12 UTC
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 19:43:29 UTC
Identified some blocking bugs that will require this fix to be deferred.

Comment 4 Dan Mace 2013-11-07 21:49:34 UTC
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 16:59:43 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/a55e99c2a4aec4ccb0c90ec1a069e99e473a90bc
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 20:55:24 UTC
Removing the block on bug 1028154.

Comment 7 Yan Du 2013-11-11 11:25:02 UTC
test on devenv 4016

steps:
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.