Bug 1261451 - trigger type in buildconfig can be updated and saved with invalid value
Summary: trigger type in buildconfig can be updated and saved with invalid value
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Build
Version: 3.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Cesar Wong
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-09 11:05 UTC by Chao Yang
Modified: 2015-11-23 21:15 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-23 21:15:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


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