Bug 969605 - non-executable bin/control script fails to be ignored
Summary: non-executable bin/control script fails to be ignored
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Paul Morie
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-31 22:05 UTC by Jhon Honce
Modified: 2015-05-14 23:20 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-11 04:15:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jhon Honce 2013-05-31 22:05:44 UTC
Description of problem:
A bin/control file that is not executable should be ignored and not generate an error.

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


How reproducible:
always

Steps to Reproduce:
1. Create a cartridge (downloadable easiest) and chmod a-x bin/control
2. Attempt to create an application with the cartridge


Actual results:
'set -e' cannot be run error

Expected results:
no error and hooks run if available

Additional info:

Comment 1 Paul Morie 2013-06-03 14:08:30 UTC
We used to have a validation for this:

origin-server/node/lib/openshift-origin-node/model/cartridge_repository.rb

...but it's commented out now.  Tracking down why it was.

Comment 2 Paul Morie 2013-06-03 18:09:21 UTC
PR submitted to stage and master.

I added a validation so that users will get an error if a cartridge control script is not executable, as well as a code change to ensure that user's won't hit the "'set -e' cannot be run" error if the cartridge author leaves the bin dir unlocked and they chmod -x the control script.

Comment 4 Meng Bo 2013-06-04 06:10:06 UTC
Checked on devenv_3313, issue has been fixed.

Create app with download cartridge which bin/control with 644 permission will get error message during creation.

# rhc app create app1 https://raw.github.com/bmeng/downloadable-mock/master/metadata/manifest.yml --no-dns
The cartridge 'https://raw.github.com/bmeng/downloadable-mock/master/metadata/manifest.yml' will be downloaded and installed

Application Options
-------------------
  Namespace:  bmengdev
  Cartridges: https://raw.github.com/bmeng/downloadable-mock/master/metadata/manifest.yml
  Gear Size:  default
  Scaling:    no

Creating application 'app1' ... 
Malformed cartridge (downloadable-mock, 0.1, 0.0.1):
bin/control is not executable


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