Bug 1312477

Summary: oc new-build --binary always creates docker type build
Product: OKD Reporter: Ben Parees <bparees>
Component: BuildAssignee: Cesar Wong <cewong>
Status: CLOSED CURRENTRELEASE QA Contact: Wenjing Zheng <wzheng>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs, ccoleman, haowang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 17:16:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ben Parees 2016-02-26 19:52:49 UTC
Description of problem:

oc new-build --binary <some s2i imagestream> should create a source type build(because the image is a builder), but it creates a docker type build instead.

you can't specify --strategy because that requires you also specify source, and you can't specify source with a binary build.


oc new-build --binary should create a docker or s2i type build as appropriate based on the image type (since it can't check the repo like it normally would)

Comment 1 Wang Haoran 2016-02-29 06:06:21 UTC
(In reply to Ben Parees from comment #0)
> Description of problem:
> 
> oc new-build --binary <some s2i imagestream> should create a source type
> build(because the image is a builder), but it creates a docker type build
> instead.
> 
> you can't specify --strategy because that requires you also specify source,
> and you can't specify source with a binary build.
> 
> 
> oc new-build --binary should create a docker or s2i type build as
> appropriate based on the image type (since it can't check the repo like it
> normally would)
Does this mean if the image is a builder image will create a s2i build type,and for normal image, will create a docker build type ?

Comment 2 Ben Parees 2016-02-29 13:54:58 UTC
> Does this mean if the image is a builder image will create a s2i build type,and > for normal image, will create a docker build type ?

by default yes (though we may only detect that for imagestreams.  detecting it for raw docker images is harder), but regardless the user should also be able to override the behavior with --strategy

Comment 3 Cesar Wong 2016-03-02 00:52:15 UTC
Fixed with https://github.com/openshift/origin/pull/7702

Comment 4 Wang Haoran 2016-03-02 03:04:04 UTC
verified against origin,update the status to modified.
steps:
#oc new-build --binary ruby
#oc new-build --binary registry.access.redhat.com/rhscl/ruby-22-rhel7:latest -n haowang --to=haowang/ruby22test
#oc new-build --binary registry.access.redhat.com/rhscl/ruby-22-rhel7:latest -n haowang --to=haowang/ruby22test1 --strategy=docker
[root@ip-172-18-8-159 origin]# oc get bc
NAME          TYPE      FROM      LATEST
ruby          Source    Binary    0
ruby22test    Source    Binary    0
ruby22test1   Docker    Binary    0

Comment 5 Wang Haoran 2016-03-02 05:18:54 UTC
As bug is against the origin ,mark verified.