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 Sep 26, 2022
1 parent 1b875f7 commit c7262ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -66,6 +66,8 @@
with Konnect cloud. A clear error message is provided when this
command is invoked.
[#718](https://github.com/Kong/deck/pull/#718)
- Improve error message when workspace is used in Konnect mode.
[#696](https://github.com/Kong/deck/pull/696)

## [v1.14.0]

Expand Down
9 changes: 9 additions & 0 deletions cmd/common.go
Expand Up @@ -103,6 +103,15 @@ 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: %s' from your "+
"configuration and try again", targetContent.Workspace)
}
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 c7262ae

Please sign in to comment.