Bug 1261451

Summary: trigger type in buildconfig can be updated and saved with invalid value
Product: OKD Reporter: Chao Yang <chaoyang>
Component: BuildAssignee: Cesar Wong <cewong>
Status: CLOSED CURRENTRELEASE QA Contact: Wenjing Zheng <wzheng>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs
Target Milestone: ---Keywords: Regression, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-23 21:15:33 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:
Embargoed:

Description Chao Yang 2015-09-09 11:05:57 UTC
Description of problem:
trigger type in buildconfig can be updated and saved  with invalid value

Version-Release number of selected component (if applicable):
openshift v1.0.5-301-ge61cc31
kubernetes v1.1.0-alpha.0-1605-g44c91b1

How reproducible:
Always

Steps to Reproduce:
1.create a project
oc process -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json | oc create -f -

2.oc edit bc ruby-sample-build
3.Edit trigger type and save

triggers:
  - github:
      secret: secret101
    type: GitHub123
  - generic:
      secret: secret101
    type: Generic123
  - imageChange:
      lastTriggeredImageID: openshift/ruby-20-centos7:latest
    type: ImageChange123

Actual results:
trigger type could be updated and saved

Expected results:

warning appears and it cannot be saved
BuildConfig ruby-sample-build was not valid:
# * triggers[0].type: invalid value 'GitHub123': invalid trigger type
# * triggers[1].type: invalid value 'Generic123': invalid trigger type
# * triggers[2].type: invalid value 'ImageChange123': invalid trigger type
Additional info:

Comment 1 Cesar Wong 2015-09-09 13:07:46 UTC
This is working as designed. We removed validation for trigger type because we make the server incompatible with future clients. An example is the recent addition of the ConfigChange trigger type. Because we are now adding it to BuildConfigs generated in the UI and in new-app, those clients are no longer compatible with previous versions of the server that did not recognize the ConfigChange type. Moving forward, if there are types we don't recognize, we'll simply ignore them.

Comment 2 Chao Yang 2015-09-10 11:26:54 UTC
this bug is by designed, will update the test case