Bug 1668130 - [next_gen_installer]Overriding Builder Image Scripts by invalid "scripts" in buildConfig doesn't output any message and build complete
Summary: [next_gen_installer]Overriding Builder Image Scripts by invalid "scripts" in ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.1.0
Assignee: Adam Kaplan
QA Contact: wewang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-22 01:42 UTC by wewang
Modified: 2019-06-04 10:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: source strategy builds did not validate that the "scripts" location contained valid s2i scripts Consequence: source strategy builds would complete successfully without using the overrode scripts Fix: restored validation that the "scripts" location in source strategy builds contains at least one valid s2i script Result: source strategy builds will fail if the "scripts" location does not contain any s2i scripts
Clone Of:
Environment:
Last Closed: 2019-06-04 10:42:06 UTC
Target Upstream Version:


Attachments (Terms of Use)


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

Description wewang 2019-01-22 01:42:49 UTC
Description of problem:
Overriding Builder Image Scripts by "scripts" in buildConfig doesn't output any message  and build complete, build should fail and prompt could not download scripts

Version-Release number of selected component (if applicable):
4.0.0-0.alpha-2019-01-20-082408

How reproducible:
always

Steps to Reproduce:
1.Setup invlid URL in "script: http://xxx" on buildConfig(refer [1])
2.Start build by oc start-build <BC>
3.Check the log
http://pastebin.test.redhat.com/699087

Actual results:
Build complete

Expected results:
Build should failed with could not download scripts

[1]https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/build/test-buildconfig.json

Additional info:
Should deal valid scripts and in invalid scripts

Comment 1 Adam Kaplan 2019-01-22 20:20:38 UTC
Based on my analysis, this is existing behavior. The build succeeds because the git source has valid s2i scripts - can you please confirm that this test case succeeds on a 3.11 cluster?

Comment 2 wewang 2019-01-23 01:56:18 UTC
it has invalid s2i scripts in [1]
in 3.11 the feature works,build failed with  like below info
 oc logs build/ruby-sample-build-2
      ERROR: script "assemble" found by the script URL handler, but failed to install: Get http:///foo.bar.com/invalid/assemble/assemble: http: no Host in request URL
      error: build error: could not download any scripts from URL http:/foo.bar.com/invalid/assemble

Comment 3 wewang 2019-01-23 02:00:19 UTC
part of file like below:

    "strategy": {
      "type": "Source",
      "sourceStrategy": {
        "from": {
          "kind": "DockerImage",
          "name": "docker.io/centos/ruby-23-centos7:latest"
        },
          "scripts": "http:/foo.bar.com/invalid/assemble"
      },
}

Comment 4 Adam Kaplan 2019-01-23 16:31:53 UTC
source-to-image PR: https://github.com/openshift/source-to-image/pull/947

Comment 5 openshift-github-bot 2019-01-23 16:55:05 UTC
Commit pushed to master at https://github.com/openshift/source-to-image

https://github.com/openshift/source-to-image/commit/c268d8c561d1a504de46a64e20e2139c3b951b6e
dockerfile - Report Error if No Scripts Install

* Raise an error if no scripts are downloaded from the ScriptsURL
* Update unit and integration tests to check for raised errors

Fixes bug 1668130

Comment 6 Adam Kaplan 2019-01-23 18:22:13 UTC
builder PR: https://github.com/openshift/builder/pull/37

Comment 7 Adam Kaplan 2019-01-25 14:09:40 UTC
Builder PR merged at https://github.com/openshift/builder

https://github.com/openshift/builder/commit/918f4590f10bc644bd0e2d8a481469410bb825d6
Merge pull request #37 from adambkaplan/bump-bz-1668130

bump(*) - s2i fix for bad ScriptsURL

Comment 9 wewang 2019-01-28 08:28:02 UTC
verified in 4.0.0-0.nightly-2019-01-25-205123
payload:  registry.svc.ci.openshift.org/ocp/release@sha256:ef5a60a10812f2fa1e4c93a5042c1520ca55675f9b4085b08579510d71031047

[wewang@wangwen ~]$ oc logs bc/ruby-sample-build --loglevel=5
Cloning "https://github.com/openshift/ruby-hello-world.git" ...
	Commit:	787f1beae9956c959c6af62ee43bfdda73769cf7 (Merge pull request #78 from bparees/v22)
	Author:	Ben Parees <bparees@users.noreply.github.com>
	Date:	Thu Jan 17 17:21:03 2019 -0500
Caching blobs under "/var/cache/blobs".
Pulling docker://docker.io/centos/ruby-23-centos7:latest
Getting image source signatures
Copying blob sha256:a02a4930cb5d36f3290eb84f4bfa30668ef2e9fe3a1fb73ec015fc58b9958b17
Copying blob sha256:70cd6e3d07d1e04c76ab381733edeb047304201da2e787a54169487fc50df42e
Copying blob sha256:223ac6fd4e5e8b913bd473593d40f0a0ab4c61122f9334e119737ddb545b1ef0
Copying blob sha256:dccd6afbeb2dbebdc2121a050fa7e164c8994b79229bcfe711c1adc4e4079ecd
Copying blob sha256:b7cd75d97ede5cba81f626711af09540fb87b6713e09cbf74807d65a3df7d3d0
Copying blob sha256:a0bf97eab929c05aa855cee7d9652668d869871e231f4bbb5a839280ae777a6a
Copying blob sha256:1a0fbe595141aeeb79b21e571c8a02b14a7996343cda32a0ed27b200563d5c5c
Copying blob sha256:1432623a31c8988aac2639e086d5519f0130e199548af558bc245f2f6890fa99
Copying blob sha256:ffdc2dafbd8129fb4408c480bb89d779bed1492df3d01ad359eab59ed6c8c94b
Copying config sha256:126da4f0da4119ae0ea0d09a2c995ca562ab12c15fa3ce32a7ee2eb0c2ce6833
Writing manifest to image destination
Storing signatures
126da4f0da4119ae0ea0d09a2c995ca562ab12c15fa3ce32a7ee2eb0c2ce6833
Generating dockerfile with builder image docker.io/centos/ruby-23-centos7:latest
error: build error: could not download any scripts from URL http:/foo.bar.com/invalid/assemble

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