From e6c9c161d699f4fa3634c3e15cb2ae6250893021 Mon Sep 17 00:00:00 2001 From: lena-larionova <54370747+lena-larionova@users.noreply.github.com> Date: Mon, 21 Aug 2023 15:50:58 -0700 Subject: [PATCH 1/4] docs(cli): add a long description for file render --- cmd/file_render.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cmd/file_render.go b/cmd/file_render.go index c5b26b138..57ccd4cbf 100644 --- a/cmd/file_render.go +++ b/cmd/file_render.go @@ -27,8 +27,19 @@ func executeFileRenderCmd(_ *cobra.Command, _ []string) error { func newFileRenderCmd() *cobra.Command { renderCmd := &cobra.Command{ Use: "render", - Short: "Render the configuration as Kong declarative config", - Long: ``, + Short: "Combines multiple complete configuration files into one Kong declarative config file.", + Long: `Combines multiple complete configuration files into one Kong + declarative config file. + + This command can render the output in JSON or YAML format. Unlike + "deck file merge", the render command accepts complete configuration files, + while "deck file merge" only combines partial file snippets. + + For example, the following command takes two input files and renders them as one + combined JSON file: + + deck file render kong1.yml kong2.yml -o kong3 --format json + `, Args: cobra.ArbitraryArgs, RunE: executeFileRenderCmd, PreRunE: func(cmd *cobra.Command, args []string) error { From e321deb76023e280afbb6fe9804030da5c8f8c80 Mon Sep 17 00:00:00 2001 From: lena-larionova <54370747+lena-larionova@users.noreply.github.com> Date: Fri, 15 Sep 2023 10:08:31 -0700 Subject: [PATCH 2/4] apply reviewer feedback Co-authored-by: Rick Spurgeon --- cmd/file_render.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/file_render.go b/cmd/file_render.go index 57ccd4cbf..72799bf5d 100644 --- a/cmd/file_render.go +++ b/cmd/file_render.go @@ -31,9 +31,10 @@ func newFileRenderCmd() *cobra.Command { Long: `Combines multiple complete configuration files into one Kong declarative config file. - This command can render the output in JSON or YAML format. Unlike - "deck file merge", the render command accepts complete configuration files, - while "deck file merge" only combines partial file snippets. + This command renders a full declarative configuration in JSON or YAML format by assembling multiple files and populating defaults and environment substitutions. This command is useful to observe what configuration would be sent prior to synchronizing to the gateway. + +In comparison to the "deck file merge" command, the render command accepts complete configuration files, + while "deck file merge" can operate on partial files. For example, the following command takes two input files and renders them as one combined JSON file: From 1581323cf53d97958b593185517e4bc8159207fc Mon Sep 17 00:00:00 2001 From: lena-larionova <54370747+lena-larionova@users.noreply.github.com> Date: Fri, 15 Sep 2023 10:10:30 -0700 Subject: [PATCH 3/4] line breaks and add "render" to short desc --- cmd/file_render.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/file_render.go b/cmd/file_render.go index 72799bf5d..567e820dc 100644 --- a/cmd/file_render.go +++ b/cmd/file_render.go @@ -27,14 +27,17 @@ func executeFileRenderCmd(_ *cobra.Command, _ []string) error { func newFileRenderCmd() *cobra.Command { renderCmd := &cobra.Command{ Use: "render", - Short: "Combines multiple complete configuration files into one Kong declarative config file.", - Long: `Combines multiple complete configuration files into one Kong + Short: "Combines multiple complete configuration files and renders them as one Kong declarative config file.", + Long: `Combines multiple complete configuration files and renders them as one Kong declarative config file. - This command renders a full declarative configuration in JSON or YAML format by assembling multiple files and populating defaults and environment substitutions. This command is useful to observe what configuration would be sent prior to synchronizing to the gateway. + This command renders a full declarative configuration in JSON or YAML format by assembling + multiple files and populating defaults and environment substitutions. + This command is useful to observe what configuration would be sent prior to synchronizing to + the gateway. -In comparison to the "deck file merge" command, the render command accepts complete configuration files, - while "deck file merge" can operate on partial files. + In comparison to the "deck file merge" command, the render command accepts + complete configuration files, while "deck file merge" can operate on partial files. For example, the following command takes two input files and renders them as one combined JSON file: From 2e2a096657467634ea328e67d1efb98114a8dcb9 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 21 Sep 2023 16:26:08 +0200 Subject: [PATCH 4/4] satisfy linter stuff --- cmd/file_render.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/file_render.go b/cmd/file_render.go index 567e820dc..b6985340b 100644 --- a/cmd/file_render.go +++ b/cmd/file_render.go @@ -28,24 +28,24 @@ func newFileRenderCmd() *cobra.Command { renderCmd := &cobra.Command{ Use: "render", Short: "Combines multiple complete configuration files and renders them as one Kong declarative config file.", - Long: `Combines multiple complete configuration files and renders them as one Kong - declarative config file. + Long: `Combines multiple complete configuration files and renders them as one Kong +declarative config file. - This command renders a full declarative configuration in JSON or YAML format by assembling - multiple files and populating defaults and environment substitutions. - This command is useful to observe what configuration would be sent prior to synchronizing to - the gateway. +This command renders a full declarative configuration in JSON or YAML format by assembling +multiple files and populating defaults and environment substitutions. +This command is useful to observe what configuration would be sent prior to synchronizing to +the gateway. - In comparison to the "deck file merge" command, the render command accepts - complete configuration files, while "deck file merge" can operate on partial files. +In comparison to the "deck file merge" command, the render command accepts +complete configuration files, while "deck file merge" can operate on partial files. - For example, the following command takes two input files and renders them as one - combined JSON file: +For example, the following command takes two input files and renders them as one +combined JSON file: - deck file render kong1.yml kong2.yml -o kong3 --format json - `, - Args: cobra.ArbitraryArgs, - RunE: executeFileRenderCmd, + deck file render kong1.yml kong2.yml -o kong3 --format json +`, + Args: cobra.ArbitraryArgs, + RunE: executeFileRenderCmd, PreRunE: func(cmd *cobra.Command, args []string) error { fileRenderCmdKongStateFile = args if len(fileRenderCmdKongStateFile) == 0 {