Bug 1330871 - No validation of build source type and build strategy type
Summary: No validation of build source type and build strategy type
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-27 07:56 UTC by Wang Haoran
Modified: 2016-09-07 21:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-07 21:30:31 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Wang Haoran 2016-04-27 07:56:40 UTC
Description of problem:
When using oc edit to update the bc, and fill with the wrong type , when type :wq , vim exited successfully.

Version-Release number of selected component (if applicable):
openshift v3.2.0.20
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5


How reproducible:
always

Steps to Reproduce:
1.Create a project
2.Create a app
oc process -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/image/language-image-templates/php-56-rhel7-stibuild.json| oc create -f -
3.edit the bc update the source type to Git123
oc edit bc php-sample-build
spec:
..............
source:
    git:
      uri: https://github.com/wzheng1/php-example-app
    type: Git123
4. edit bc update the build strategy to Source123
strategy:
    sourceStrategy:
      from:
        kind: ImageStreamTag
        name: php-56-rhel7:latest
    type: Source123
Actual results:

step 3 and 4 succeed.
Expected results:
Should not save sucessfully and pop out the wrong message,validation should be more restrict.
Additional info:
There is a bug before https://bugzilla.redhat.com/show_bug.cgi?id=1279288 , which fixed this , but after update the bc structure , It appears again.
code here:
https://github.com/openshift/origin/blob/master/pkg/build/api/validation/validation.go#L373
https://github.com/openshift/origin/blob/master/pkg/build/api/validation/validation.go#L132

Comment 1 Wang Haoran 2016-05-01 14:44:33 UTC
According to this commit[1], disable the type validation is to support multiple source input , if this is not a bug , feel free to close this.

[1]https://github.com/openshift/origin/commit/6d31fd277df0632bbb96ecea64e79d10b7e55d27

Comment 2 Ben Parees 2016-06-27 15:46:57 UTC
That field is now deprecated, so you can put any value you want into it, it will be ignored and you'll notice that when you view the buildconfig again, the type field will be reset to the appropriate value based on which strategy field is defined.


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