Bug 1123891 - Succeed to add cartridge even with invalid template url via oo-cartridge
Summary: Succeed to add cartridge even with invalid template url via oo-cartridge
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1121067
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-28 14:53 UTC by Brenton Leanhardt
Modified: 2014-09-18 15:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1121067
Environment:
Last Closed: 2014-09-12 19:57:54 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1123893 None None None Never

Internal Links: 1123893

Description Brenton Leanhardt 2014-07-28 14:53:08 UTC
+++ This bug was initially created as a clone of Bug #1121067 +++

Description:
Succeed to add cartridge even when user define invalid template url to add cartridge:

[root@ip-10-61-173-184 ~]# oo-cartridge  --with-container-uuid 123456 --action add --with-cartridge-name perl-5.10 --with-template-url git@github.com:123
Cartridge add succeeded
[root@ip-10-61-173-184 ~]# ls /var/lib/openshift/123456/
app-deployments  app-root  git  perl

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

How reproducible:
always

steps to Reproduce:
1. Create a container
2. Add cartridge with invalid template
# oo-cartridge  --with-container-uuid 123456 --action add --with-cartridge-name perl-5.10 --with-template-url git@github.com:123

Actual results:
It displays succeed and the cartridge can be added to the container

Expected results:
It should not be added successfully and a warning like this should appears:
Cartridge add failed
CLIENT_ERROR: Source code repository could not be cloned: 'git@github.com:123'. Please verify the repository is correct and contact support.: rc(131

Additional info:
This issue doesn't exist in fork_ami_origin_node_401_1222 and latest devenv_4978

--- Additional comment from Jhon Honce on 2014-07-21 12:22:52 EDT ---

I get the error message using the new code.  Using oo-cartridge, the cartridge is always added to the gear whether there is an error or not.

Merging code to master: https://github.com/openshift/origin-server/pull/5634

--- Additional comment from Wenjing Zheng on 2014-07-21 23:41:00 EDT ---

Test on devenv_4992. the error appears like below but the cartridge can be added:
[root@ip-10-144-207-61 ~]# oo-cartridge  --with-container-uuid 123456 --action add --with-cartridge-name perl-5.10 --with-template-url git@123
Cartridge add failed
CLIENT_ERROR: Source code repository URL protocol must be one of: git, git@, http, https, ftp, ftps, rsync, file: rc(130
[root@ip-10-144-207-61 ~]# oo-cartridge  --with-container-uuid 123456 --action add --with-cartridge-name perl-5.10 --with-template-url file://123
Cartridge add failed
CLIENT_ERROR: Source code repository could not be cloned: 'file://123'. Please verify the repository is correct and contact support.: rc(131
[root@ip-10-144-207-61 ~]# oo-cartridge  --with-container-uuid 123456 --action add --with-cartridge-name perl-5.10 --with-template-url git@github.com:123
Cartridge add failed
CLIENT_ERROR: The provided source code repository URL is not valid (bad URI(is not URI?): git@github.com:123): rc(130

If the cartridge won't be influenced by template url, it can be added anyway, can the warning be more clear, like "cartridge add succeeded, however there is a warning about ...."?

--- Additional comment from Jhon Honce on 2014-07-24 14:43:33 EDT ---

Fixed in https://github.com/openshift/origin-server/pull/5656

--- Additional comment from openshift-github-bot on 2014-07-24 16:30:25 EDT ---

Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/1ede045bcad26236f10e004b0a70916766e430b8
Bug 1121067 - Updated error messages

--- Additional comment from Wenjing Zheng on 2014-07-24 21:56:57 EDT ---

Verified on devenv_5008, for the cartridge can be added even providing incorrect template url, so the warning message displays "Cartridge add succeeded".

Comment 1 Brenton Leanhardt 2014-07-28 14:56:30 UTC
This was fixed upstream in the same pull request that fixed Bug #1121864.  Whoever backports this would be sure to label the downstream Bug #1123893 as ON_QA as well.


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