New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: improve errors when running against Konnect with workspace config #696
Conversation
Codecov Report
@@ Coverage Diff @@
## main #696 +/- ##
==========================================
- Coverage 43.50% 43.46% -0.04%
==========================================
Files 74 74
Lines 8923 8931 +8
==========================================
Hits 3882 3882
- Misses 4671 4679 +8
Partials 370 370
Continue to review full report at Codecov.
|
cmd/common.go
Outdated
@@ -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" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to be multi line error message (\n
)?
3e3e4f7
to
9ef8a61
Compare
Please rebase. |
9ef8a61
to
5810ada
Compare
done |
5810ada
to
5f184eb
Compare
5f184eb
to
de491a8
Compare
cmd/common.go
Outdated
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'foo' seems to be a copy-paste error. Could you please update the error message to include the workspace that the user has provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
$ ./deck sync --konnect-token $TOKEN_DEV
Error: _workspace set in config file.
Workspaces are not supported in Konnect. Please remove '_workspace: test' from your configuration and try again
de491a8
to
02f125d
Compare
02f125d
to
05f0bcd
Compare
No description provided.