Bug 1670000 - [4.0] Should not set the post-commit hook as a set of arguments to the default image entrypoint and should give error info
Summary: [4.0] Should not set the post-commit hook as a set of arguments to the defaul...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.1.0
Assignee: Corey Daley
QA Contact: wewang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-28 10:34 UTC by wewang
Modified: 2019-06-04 10:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-04 10:42:19 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:42:25 UTC

Description wewang 2019-01-28 10:34:42 UTC
Description of problem:
In 4.0 postcommit are not support args, refer[1], so should not set the post-commit hook as a set of arguments to the default image entrypoint

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

How reproducible:
always

Steps to Reproduce:
1.oc set build-hook bc/ruby-hello-world --post-commit  --help
 # Set the post-commit hook as a set of arguments to the default image entrypoint
  oc set build-hook bc/mybuild --post-commit  -- arg1 arg2

2.example
oc set build-hook bc/ruby-hello-world --post-commit  -- arg1 arg2
    postCommit:
      args:
      - arg1
      - arg2

3.

Actual results:
display  oc set build-hook bc/mybuild --post-commit  -- arg1 arg2


Expected results:
should delete the info in help, and when execute the command should give error info

Additional info:

[1]https://github.com/openshift/origin/pull/21389/files

Comment 1 Corey Daley 2019-01-28 17:57:43 UTC
Opened pull request https://github.com/openshift/origin/pull/21880 to address this issue

Comment 2 Corey Daley 2019-02-03 01:48:26 UTC
Pull request has merged.

Comment 3 wewang 2019-02-15 10:43:47 UTC
Checked in version
4.0.0-0.nightly-2019-02-13-204401
registry.svc.ci.openshift.org/ocp/release@sha256:8168c9d2a331b6e8ca5e9b08f623d7f0ff50277bbc63fa71b1bc2a8c806f2ddf
oc v4.0.0-0.173.0

steps: 
oc set build-hook bc/ruby-sample-build --post-commit --help
Examples:
  # Clear post-commit hook on a build config
  oc set build-hook bc/mybuild --post-commit --remove
  
  # Set the post-commit hook to execute a test suite using a new entrypoint
  oc set build-hook bc/mybuild --post-commit --command -- /bin/bash -c /var/lib/test-image.sh
  
  # Set the post-commit hook to execute a shell script
  oc set build-hook bc/mybuild --post-commit --script="/var/lib/test-image.sh param1 param2 && /var/lib/done.sh"

-----------
and tested it with script, build complete. verified the bug
$ oc set build-hook bc/ruby-sample-build --post-commit --script="bundle exec rake test" -n wewang3
[wewang@Desktop ~]$ oc get builds -n wewang3 --watch
NAME                  TYPE     FROM          STATUS     STARTED          DURATION
ruby-sample-build-1   Source   Git@787f1be   Complete   14 minutes ago   1m51s
ruby-sample-build-2   Source   Git@787f1be   Complete   9 minutes ago    2m32s

Comment 6 errata-xmlrpc 2019-06-04 10:42:19 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.

https://access.redhat.com/errata/RHBA-2019:0758


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