Skip to content

Commit

Permalink
fix: improve errors when running against Konnect with workspace config
Browse files Browse the repository at this point in the history
  • Loading branch information
GGabriele committed Aug 17, 2022
1 parent 49d2f98 commit 5f184eb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Table of Contents

- [Unreleased](#Unreleased)
<<<<<<< HEAD
- [v1.13.0](#v1130)
=======
>>>>>>> 9ef8a61 (address comments)
- [v1.12.4](#v1124)
- [v1.12.3](#v1123)
- [v1.12.2](#v1122)
Expand Down Expand Up @@ -52,6 +55,11 @@
- Support PAT (Personal Access Tokens) for Konnect authentication.
[#710](https://github.com/Kong/deck/pull/710)

### Fixes

- Improve error message when workspace is used in Konnect mode.
[#696](https://github.com/Kong/deck/pull/696)

## [v1.13.0]

> Release date: 2022/07/14
Expand Down Expand Up @@ -993,7 +1001,11 @@ No breaking changes have been introduced in this release.

Debut release of decK

<<<<<<< HEAD
[v1.13.0]: https://github.com/kong/deck/compare/v1.12.4...v1.13.0
=======
[Unreleased]: https://github.com/kong/deck/compare/v1.12.4...Unreleased
>>>>>>> 9ef8a61 (address comments)
[v1.12.4]: https://github.com/kong/deck/compare/v1.12.3...v1.12.4
[v1.12.3]: https://github.com/kong/deck/compare/v1.12.2...v1.12.3
[v1.12.2]: https://github.com/kong/deck/compare/v1.12.1...v1.12.2
Expand Down
8 changes: 8 additions & 0 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ func syncMain(ctx context.Context, filenames []string, dry bool, parallelism,
var kongClient *kong.Client
mode := getMode(targetContent)
if mode == modeKonnect {
if targetContent.Workspace != "" {
return fmt.Errorf("_workspace set in config file.\n" +
"Workspaces are not supported in Konnect. " +
"Please remove '_workspace: foo' from your configuration and try again")
}
if workspace != "" {
return fmt.Errorf("--workspace flag is not supported when running against Konnect")
}
if targetContent.Konnect != nil {
if konnectRuntimeGroup != "" &&
targetContent.Konnect.RuntimeGroupName != konnectRuntimeGroup {
Expand Down

0 comments on commit 5f184eb

Please sign in to comment.