Skip to content

Commit

Permalink
fix(cli): validate was setting wrong filenames (#1084)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske authored Nov 3, 2023
1 parent 8ce58a6 commit b3ccdd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions cmd/gateway_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" +
Expand Down

0 comments on commit b3ccdd5

Please sign in to comment.