-
Bug
-
Resolution: Done
-
Minor
-
None
-
4.12.0
-
No
-
ODC Sprint 238
-
1
-
Rejected
-
False
-
This is a clone of issue OCPBUGS-9909. The following is the description of the original issue:
—
Description of problem:
Version-Release number of selected component (if applicable):
All versions?
At least on 4.12+
How reproducible:
Always
Steps to Reproduce:
- Open the console and click on the + sign in the top right navigation header.
This JSON works fine:
{ "apiVersion": "v1", "kind": "ConfigMap", "metadata": { "generateName": "a-configmap-" } }
But neither an array could be used to import multiple resources:
[ { "apiVersion": "v1", "kind": "ConfigMap", "metadata": { "generateName": "a-configmap-" } }, { "apiVersion": "v1", "kind": "ConfigMap", "metadata": { "generateName": "a-configmap-" } } ]
Fails with error: No "apiVersion" field found in YAML.
Nor a Kubernetes List "resource" could be used:
{ "apiVersion": "v1", "kind": "List", "items": [ { "apiVersion": "v1", "kind": "ConfigMap", "metadata": { "generateName": "a-configmap-" } }, { "apiVersion": "v1", "kind": "ConfigMap", "metadata": { "generateName": "a-configmap-" } } ] }
Fails with error: The server doesn't have a resource type "kind: List, apiVersion: v1".
Actual results:
Both JSON structures could not be imported.
Expected results:
Both JSON structures works fine and create multiple resources.
If the JSON array contains just one item the resource detail page should be opened, otherwise the import result page similar to when the user imports a yaml with multiple resources.
Additional info:
Found this JSON structure for example in issue OCPBUGS-4646
- blocks
-
OCPBUGS-19382 Could not import multiple resources via JSON (while YAML supports this)
- Closed
- clones
-
OCPBUGS-9909 Could not import multiple resources via JSON (while YAML supports this)
- Closed
- is blocked by
-
OCPBUGS-9909 Could not import multiple resources via JSON (while YAML supports this)
- Closed
- is cloned by
-
OCPBUGS-19382 Could not import multiple resources via JSON (while YAML supports this)
- Closed
- links to