From 0f27671a0d634c784b0f6b75075491b47c92a138 Mon Sep 17 00:00:00 2001 From: Samuel Padgett Date: Mon, 4 Nov 2019 12:41:11 -0500 Subject: [PATCH 1/2] Bug 1768542: Add `snippet` flag to ConsoleYAMLSample CRD Snippets let you insert a partial YAML definition at the user's cursor in the console YAML editor. --- console/v1/types_console_yaml_sample.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/console/v1/types_console_yaml_sample.go b/console/v1/types_console_yaml_sample.go index 70fa0c471e4..289d0ebe420 100644 --- a/console/v1/types_console_yaml_sample.go +++ b/console/v1/types_console_yaml_sample.go @@ -27,6 +27,11 @@ type ConsoleYAMLSampleSpec struct { Description ConsoleYAMLSampleDescription `json:"description"` // yaml is the YAML sample to display. YAML ConsoleYAMLSampleYAML `json:"yaml"` + // snippet indicates that the YAML sample is not the full YAML resource + // definition, but a fragment that can be inserted into the existing + // YAML document at the user's cursor. + // +optional + Snippet bool `json:"snippet"` } // ConsoleYAMLSampleTitle of the YAML sample. From 1884d963dee3095107edef7380702f1085ef94ca Mon Sep 17 00:00:00 2001 From: Samuel Padgett Date: Mon, 4 Nov 2019 12:51:44 -0500 Subject: [PATCH 2/2] generated --- console/v1/0000_10_consoleyamlsample.crd.yaml | 5 +++++ console/v1/zz_generated.swagger_doc_generated.go | 1 + 2 files changed, 6 insertions(+) diff --git a/console/v1/0000_10_consoleyamlsample.crd.yaml b/console/v1/0000_10_consoleyamlsample.crd.yaml index 3ecd991bf6c..f097466b12d 100644 --- a/console/v1/0000_10_consoleyamlsample.crd.yaml +++ b/console/v1/0000_10_consoleyamlsample.crd.yaml @@ -54,6 +54,11 @@ spec: description: description of the YAML sample. type: string pattern: ^(.|\s)*\S(.|\s)*$ + snippet: + description: snippet indicates that the YAML sample is not the full + YAML resource definition, but a fragment that can be inserted into + the existing YAML document at the user's cursor. + type: boolean targetResource: description: targetResource contains apiVersion and kind of the resource YAML sample is representating. diff --git a/console/v1/zz_generated.swagger_doc_generated.go b/console/v1/zz_generated.swagger_doc_generated.go index 8c8be4f6562..1012e915f34 100644 --- a/console/v1/zz_generated.swagger_doc_generated.go +++ b/console/v1/zz_generated.swagger_doc_generated.go @@ -142,6 +142,7 @@ var map_ConsoleYAMLSampleSpec = map[string]string{ "title": "title of the YAML sample.", "description": "description of the YAML sample.", "yaml": "yaml is the YAML sample to display.", + "snippet": "snippet indicates that the YAML sample is not the full YAML resource definition, but a fragment that can be inserted into the existing YAML document at the user's cursor.", } func (ConsoleYAMLSampleSpec) SwaggerDoc() map[string]string {