Bug 1776479
Summary: | Try It button for ConsoleYAMLSample resources silently fails on invalid YAML | ||||||
---|---|---|---|---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | bpeterse | ||||
Component: | Management Console | Assignee: | Samuel Padgett <spadgett> | ||||
Status: | CLOSED ERRATA | QA Contact: | Yadan Pei <yapei> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 4.3.0 | CC: | aos-bugs, bparees, jokerman, spadgett, yapei | ||||
Target Milestone: | --- | ||||||
Target Release: | 4.4.0 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | No Doc Update | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 1778863 1779681 (view as bug list) | Environment: | |||||
Last Closed: | 2020-05-04 11:17:08 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: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1778863, 1779681 | ||||||
Attachments: |
|
Description
bpeterse
2019-11-25 18:49:12 UTC
The example(In reply to bpeterse from comment #0) > ``````` > apiVersion: console.openshift.io/v1 > kind: ConsoleYAMLSample > metadata: > name: foo-pod-example > spec: > targetResource: > apiVersion: v1 > kind: Pod > title: foo pod example > description: our company's preferred foo pod > yaml: >- > apiVersion: v1 > kind: Pod > metadata: > name: foo-pod-example > labels: > app: web > foo: bar > bar: baz > spec: > containers: > - name: foo-pod-example > image: foopod/example > command: ["foo"] > args: ["--example", "1"] > ``````` This should be: ``` apiVersion: console.openshift.io/v1 kind: ConsoleYAMLSample metadata: name: foo-pod-example spec: targetResource: apiVersion: v1 kind: Pod title: foo pod example description: our company's preferred foo pod yaml: >- apiVersion: v1 kind: Pod metadata: name: foo-pod-example labels: app: web foo: bar bar: baz spec: containers: - name: foo-pod-example image: foopod/example command: ["foo"] args: ["--example", "1"] ``` I believe this bug is occurring because Ben's example uses the yaml folded style block style indicator (`>`) instead of the literal block style indicator (`|`) in the yaml value, so the new lines get stripped. Not sure how we go about enforcing the use of the literal block style indicator... It looks like the indentation is wrong is the provided YAML. The `yaml` property should not be under `targetResource`, but one level up. It should be a required property, though. I'd expect that to fail validation. I get an error when I try to create that resource.
> Error "Required value" for field "spec.description".
Is there a copy/paste error in the YAML in the description?
(In reply to Samuel Padgett from comment #3) > It looks like the indentation is wrong is the provided YAML. The `yaml` > property should not be under `targetResource`, but one level up. It should > be a required property, though. I'd expect that to fail validation. Ben's example is incorrect and does fail validation. I provided a corrected example in https://bugzilla.redhat.com/show_bug.cgi?id=1776479#c1. However, this corrected example fails due to the use of the folded style block indicator (see https://bugzilla.redhat.com/show_bug.cgi?id=1776479#c2). 1. Create ConsoleYAMLSample instance with yaml in comment #1 2. Goes to Workloads -> Pods -> Create Pods -> click Try It button in Samples An error modal will prompt and show Failed to Parse YAML Sample Verified on 4.4.0-0.nightly-2019-12-15-184910 Created attachment 1645420 [details]
ModalShowingError
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://access.redhat.com/errata/RHBA-2020:0581 |