+++ This bug was initially created as a clone of Bug #1104140 +++ Description of problem: Try to do binary deploy on the app with git deploy method configured via rest api, will get succeeded. Vice versa. Version-Release number of selected component (if applicable): STG(devenv-stage_861) devenv-stage_861 How reproducible: always Steps to Reproduce: 1. Create app of any type 2. Do binary deploy via rest api without change the app configure to use binary deploy method # curl -k -H "Accept: application/xml" --user "bmeng:123123" https://localhost/broker/rest/application/538dcd847c317b9d03000009/deployments -XPOST -d artifact_url=http://cphp-ccyd.rhcloud.com/cphp2.tar.gz 3. Actual results: Will get succeeded. <status>created</status> <type>deployment</type> <data> <deployment> <created-at>2014-06-03T13:33:53Z</created-at> <hot-deploy>false</hot-deploy> <force-clean-build>false</force-clean-build> <ref>master</ref> <sha1 nil="true"></sha1> <id>a99f1e03</id> <activations> <activation>2014-06-03T13:33:56Z</activation> </activations> </deployment> </data> <messages> <message> <severity>info</severity> <text>Added a99f1e03 to application php54</text> <exit-code>0</exit-code> <field nil="true"></field> <index nil="true"></index> </message> </messages> Expected results: Should report that the app is configured as git deploy and does not support for the binary deploy. Additional info: Works well for the rhc client. # rhc deploy http://cphp-ccyd.rhcloud.com/cphp2.tar.gz -a php54 The application 'php54' is configured for git reference deployments but the artifact provided ('http://cphp-ccyd.rhcloud.com/cphp2.tar.gz') is a url. Please provide a git reference to deploy (branch, tag or commit SHA1) or configure your app to deploy from binaries with 'rhc configure-app php54 --deployment-type binary'. The artifact provided is not compatible with the app deployment type. --- Additional comment from openshift-github-bot on 2015-11-25 11:05:32 EST --- Commits pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/8a3183b4b860c9b1de530647ebc6aa6e168d4ec4 deployments_controller.rb: Adds checks for app deployment mode via REST Bug 1104140 BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1104140 Adds additional checks to verify that the app is in the correct deployment mode when deploying via the REST api. Will throw a 422 error when attempting to binary deploy in git mode or vice versa. Adds deployment types to relevant REST api tests to specify deployment mode. https://github.com/openshift/origin-server/commit/db254f5ee9cd758774427a42814f183932541571 Merge pull request #6320 from thrasher-redhat/bug1104140 Merged by openshift-bot --- Additional comment from Rory Thrasher on 2016-01-06 16:46:08 EST --- QA, Please verify that this bug has been fixed. 1. When attempting to binary deploy via the rest API while in git deployment mode (default mode), there should be a 422 error similar to "The binary artifact provided is not compatible with the app deployment type, git". 2. When attempting to git deploy via the rest API while in binary deployment mode, there should be a 422 error similar to "The git ref provided is not compatible with the app deployment type, binary". 3. When attempting to git deploy in git deployment mode or binary deploy in binary deployment mode, the deployment should succeed as normal. --- Additional comment from Meng Bo on 2016-01-08 05:26:40 EST --- <messages> <message> <severity>error</severity> <text>The git ref provided is not compatible with the app deployment type, 'binary'.</text> <exit-code>-1</exit-code> <field>ref</field> <index nil="true"></index> </message> </messages> <messages> <message> <severity>error</severity> <text>The binary artifact provided is not compatible with the app deployment type, 'git'.</text> <exit-code>-1</exit-code> <field>artifact_url</field> <index nil="true"></index> </message> </messages> Issue has been fixed, the error message shown when deploying with incorrect type.
Checked with Puddle: http://etherpad.corp.redhat.com/puddle-2-2-2016-02-19. 1. When attempting to binary deploy via the rest API while in git deployment mode (default mode), there should be a 422 error similar to "The binary artifact provided is not compatible with the app deployment type, git". 2. When attempting to git deploy via the rest API while in binary deployment mode, there should be a 422 error similar to "The git ref provided is not compatible with the app deployment type, binary". 3. When attempting to git deploy in git deployment mode or binary deploy in binary deployment mode, the deployment should succeed as normal. All as expected result.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-0489.html