Bug 1331682 - [userinterface_public_546]Should not prompt 'already exists' when resource metadata.name is not given
Summary: [userinterface_public_546]Should not prompt 'already exists' when resource me...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Hadvig
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-29 09:06 UTC by Xingxing Xia
Modified: 2016-09-19 13:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 13:55:45 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Xingxing Xia 2016-04-29 09:06:08 UTC
Description of problem:
In From File tab of create page, upload a resource file with json format (but metadata.name is not given), then Create, it pops up a small window wrongly saying:
pod '' already exists
Do you want to replace with the new content?

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

How reproducible:
Always

Steps to Reproduce:
1. oc login and create project
2. Prepare resource file with json format in local PC
$ wget https://raw.githubusercontent.com/openshift/origin/master/examples/hello-openshift/hello-pod.json

Then remove the "name" line under metadata from the file.

3. Login to Openshift web console, click Add to project --> From File --> Browse, select the json file and Create
4. oc create -f hello-pod.json


Actual results:
3. It pops up small window saying:
pod '' already exists
Do you want to replace with the new content?
                        Replace     Cancel

4. It prompts (it is expected):
The Pod "" is invalid.
metadata.name: Required value: name or generateName is required

Expected results:
3. Should prompt the resource is invalid, as same as CLI in step 4

Additional info:
The result should be same as missing other required field:
E.g. remove only spec.containers[0].name, then repeat above steps, both CLI and web console can show correct message:
Pod "hello-openshift" is invalid: spec.containers[0].name: Required value

Comment 1 Jakub Hadvig 2016-05-04 07:44:25 UTC
The PR has been merged, please use the master for testing.

Comment 2 Yadan Pei 2016-05-04 09:23:37 UTC
Checked against devenv-rhel7_4087

1. oc login and create project
2. Prepare resource file with json format in local PC
$ wget https://raw.githubusercontent.com/openshift/origin/master/examples/hello-openshift/hello-pod.json

Then remove the "name" line under metadata from the file.

3. Login to Openshift web console, click Add to project --> From File --> Browse, select the json file and Create

pod is not created, and give error message "Failed to process the resource.
Resource name is missing in metadata field"

Comment 3 Yadan Pei 2016-05-04 09:40:34 UTC
For scenario described in this bug, it works well now, move to VERIFIED


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