Bug 1300146

Summary: [fork][userinterface_public_576]Wrong prompt message when create from template contains invalid resource type
Product: OKD Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: bpeterse
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 17:12:36 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:

Description Yadan Pei 2016-01-20 03:06:43 UTC
Description of problem:
When creating from a template contains invalid resource type, it gives "Cannot create object. Unknown API version v1 for kind Test.", it should give error "Cannot create object. Unrecognized kind Test."

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

How reproducible:
Always

Steps to Reproduce:
1.Create a template "ruby-helloworld-sample" from examples/sample-app/application-template-stibuild.json
2. Change "kind": "Service" to "kind":"Test" for frontend service
3. Create from template on web console

Actual results:
Error "Cannot create object. Unknown API version v1 for kind Test" printed on next step page

Expected results:
Error "Cannot create object. Unrecognized kind Test" should printed

Additional info:

Comment 1 bpeterse 2016-01-20 21:35:44 UTC
Here are some details about APIGroups that may require updating your tests.

- We have a list of v1 resources & can verify before making API calls
- We will not have a list of resources under each API Group.  We simply have to make the request and handle the 403, 404 errors if they happen

So in the template.json,
We can look this up and know if it will succeed or fail:
"kind": "Test",
"apiVersion": "v1", 

But, we will not know if this will succeed or fail:
"kind": "Test",
"apiVersion": "foo/v1", 


I'll have to update the error message to something like this:

- "Kind Test is invalid for API version v1"

And will try to pass up useful messages for 403,404 errors (from API groups) to the UI.

Comment 2 bpeterse 2016-01-22 17:29:45 UTC
For 
"kind": "Test",
"apiVersion": "v1",

Message will be:
- Cannot create object. Kind Test is invalid for v1.

Comment 3 bpeterse 2016-01-22 17:31:25 UTC
Fix will be coming in next fork_ami.  Will update trello card when fork_ami is generated.

Comment 4 Yadan Pei 2016-01-26 02:01:21 UTC
tested on fork_ami_openshift3_userinterface_public_576_193, when create from template includes fakegroup, error info [Cannot create fakegroup.tests. User "yapei" cannot create fakegroup.tests in project "yapei-test".] will be displayed on next step page, works as expected