Description of problem: Save "Hook Types" with "Shell Script with Arguments" or "Command with Arguments", only set argument and check the bc edit page again, "Hook Types" is set to "Arguments to default image entry point" Version-Release number of selected component (if applicable): v1.5.0-alpha.1+68d4d0a-322-dirty How reproducible: Always Steps to Reproduce: 1. # oc new-project xiaocwan-t # oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json 2. # Edit bc on web console click "Show advanced options" and find "Post-Commit Hooks" set "Hook Types" -> Shell Script with Arguments Script -> <leave it empty> 1 arguments: hello -> click Add Hit Save 3. Go to the bc edit page and check "Hook Types" for "Post-Commit Hooks" 4. set "Hook Types" -> Command with Arguments Script -> <leave it empty> 1 arguments: hello -> click Add 5. Hit Save and go to the bc edit page again, check "Hook Types" for "Post-Commit Hooks" again Actual results: 3&5 "Hook Types" is set to "Arguments to default image entry point" Expected results: 3&5, Hook Types should be the value user saved. Additional info:
This is working as intended, although confusing. It switched to "Arguments to default image entry point" because you did not provide a command (so "Command with arguments" is not possible). I'm changing the editor to make the fields required based on the selected type to avoid the problem. It also keeps users from typing a command and forgetting to click the "Add" button.
Commit pushed to master at https://github.com/openshift/origin-web-console https://github.com/openshift/origin-web-console/commit/c18ec4c25a935709f1f49637495d25dc6efc2dd6 Bug 1415083 - Make build hook fields required for selected type Make the post-commit hook inputs required when the type is selected in the build hook type dropdown. Hooks can be removed by unchecking the "Run build hooks" checkbox. https://bugzilla.redhat.com/show_bug.cgi?id=1415083
Verified on openshift v3.5.0.7+390ef18 Save button is disabled when command/script is empty. "Hook Type" is remained when script has only one empty line.