Bug 1379613

Summary: dev-preview-stg]Modify Build Strategy from 'Source' to 'Custom' with successful prompt
Product: OpenShift Online Reporter: yufchang <yufchang>
Component: BuildAssignee: Corey Daley <cdaley>
Status: CLOSED NOTABUG QA Contact: Wang Haoran <haowang>
Severity: low Docs Contact:
Priority: low    
Version: 3.xCC: aos-bugs, bingli, cdaley
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-01 14:58:28 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 yufchang 2016-09-27 08:40:35 UTC
Description of problem:

Given Docker and  custom Build strategy are not allowed like in On line environment, when users try to modify strategy from 'Source' to 'Docker', There is a forbidden message. But when users try to modify strategy from 'Source' to 'Custom'. There is a successful message, In fact the modification is not saved successfully. 


Version-Release number of selected component (if applicable):

atomic-openshift-3.3.0.32-1.git.0.37bd7ea.el7.x86_64
docker-1.10.3-46.el7.14.x86_64
kernel-3.10.0-327.36.1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1.In web console build page, click 'Action' ->Edit YAML to change strategy form 'Source' to 'Custom', negative test: only update 'type' filed, not update 'customStrategy'

    type: Source        # -->  Change to Custom


2.Click save;
3.Edit Yaml to check if the modification is saved.

Actual results:
2. The system prompts'....bulid was updated';


Expected results:
2. Should prompt '...build is forbidden. Build strategy Custom is now allowed.'

Additional info:
With above modification, CLI oc edit has same result.

Comment 1 Corey Daley 2016-10-28 17:46:46 UTC
It looks like you may be misunderstanding what is happening when you are changing the values in the YAML file.

When you change the strategy type to "Custom" and leave the line below it as sourceStrategy (which is allowed), the value is automatically being converted back to "Source", it's not that it just isn't being saved and not erroring.

You can test this by changing the YAMl config as in the below examples, and you will get the correct error or either custom build strategy not allowed, or docker build strategy not allowed.

  strategy:
    type: Custom
    dockerStrategy:

or

  strategy:
    type: Custom
    customStrategy:

or

  strategy:
    type: Source
    customStrategy:

Basically the server is trying to fix the mistake itself when it can.
Please let me know if this makes sense or if you need further clarification.

Comment 2 Corey Daley 2016-11-01 14:58:28 UTC
Please feel free to re-open this bug if you have further comments or questions about it.