Skip to content

Commit

Permalink
chore: fixed workspace setting for Konnect check
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashansa-K committed Oct 10, 2024
1 parent dff8245 commit 1361bfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions cmd/gateway_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ func executeValidate(cmd *cobra.Command, _ []string) error {
if validateCmdRBACResourcesOnly {
return fmt.Errorf("[rbac] not yet supported by konnect")
}

if validateWorkspace != "" {
return fmt.Errorf("[workspaces] not supported by Konnect - use control planes instead")
}
}

if validateOnline {
Expand Down Expand Up @@ -295,6 +291,9 @@ func getKongClient(
) (*kong.Client, error) {
workspaceName := validateWorkspace
if validateWorkspace != "" {
if mode == modeKonnect {
return nil, fmt.Errorf("[workspaces] not supported by Konnect - use control planes instead")
}
// check if workspace exists
workspaceName := getWorkspaceName(validateWorkspace, targetContent, false)
workspaceExists, err := workspaceExists(ctx, rootConfig, workspaceName)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Test_Validate_Konnect(t *testing.T) {
errorString: "[rbac] not yet supported by konnect",
},
{
name: "validate with workspaces set",
name: "validate with workspace set",
stateFile: "testdata/validate/konnect.yaml",
additionalArgs: []string{"--workspace=default"},
errorExpected: true,
Expand Down

0 comments on commit 1361bfd

Please sign in to comment.