diff --git a/CHANGELOG.md b/CHANGELOG.md index 79e806eed..3e4321aea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,12 @@ - Add support for konnect AU region. [#1082](https://github.com/Kong/deck/pull/1082) +### Fixes + +- Resolved an issue in the `deck file validate` and `deck gateway validate` commands that prevented them from properly processing the provided file arguments. + [#1084](https://github.com/Kong/deck/pull/1084) + + ## [v1.28.1] > Release date: 2023/11/02 diff --git a/cmd/gateway_validate.go b/cmd/gateway_validate.go index fa2f67c46..855765a79 100644 --- a/cmd/gateway_validate.go +++ b/cmd/gateway_validate.go @@ -84,13 +84,7 @@ and alerts if there are broken relationships, or missing links present. ` execute := executeValidate argsValidator := cobra.MinimumNArgs(0) - preRun := func(cmd *cobra.Command, args []string) error { - diffCmdKongStateFile = args - if len(diffCmdKongStateFile) == 0 { - diffCmdKongStateFile = []string{"-"} - } - return preRunSilenceEventsFlag() - } + var preRun func(cmd *cobra.Command, args []string) error if deprecated { use = "validate" @@ -118,7 +112,15 @@ this command unless --online flag is used. return preRunSilenceEventsFlag() } } else { - validateOnline = online + preRun = func(cmd *cobra.Command, args []string) error { + validateOnline = online + validateCmdKongStateFile = args + if len(validateCmdKongStateFile) == 0 { + validateCmdKongStateFile = []string{"-"} + } + return preRunSilenceEventsFlag() + } + if validateOnline { short = short + " (online)" long = long + "Validates against the Kong API, via communication with Kong. This increases the\n" +