Skip to content

Feat: virtual workspace #282

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

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Feat: virtual workspace #282

wants to merge 12 commits into from

Conversation

vertex451
Copy link
Member

TBD

@vertex451 vertex451 self-assigned this Jul 16, 2025
@vertex451 vertex451 added this to the 2025.Q3 milestone Jul 16, 2025
On-behalf-of: @SAP [email protected]
Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected]
Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected]
Signed-off-by: Artem Shcherbatiuk <[email protected]>
@@ -99,38 +98,20 @@ func (tc *TargetCluster) connect(appCfg appConfig.Config, metadata *ClusterMetad
var config *rest.Config
var err error

// In multicluster mode, we MUST have metadata to connect
Copy link
Member Author

@vertex451 vertex451 Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified this part by relying fully on metadata instead of using kubeconfig exporting for connection for the gateway.
Now we have single source of truth and atomicity - for each cluster everything in the its dedicated file.
(Also, some additional manipulations were needed for virtual ws that require that config with virtual workspace list, and I don't want to add it to the gateway, listener takes care of it).

Plus, we have same approach for all types of clusters.

var clusterName string

// Handle virtual workspace format: /virtual-workspace/{virtualWorkspaceName}/{kcpWorkspace}/graphql
if len(parts) == 4 && parts[0] == "virtual-workspace" && parts[3] == "graphql" {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to improve this code, it looks very bad now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced it with pattern matching, now looks much more better :)

}

// processVirtualWorkspace generates schema for a single virtual workspace
func (r *VirtualWorkspaceReconciler) processVirtualWorkspace(ctx context.Context, workspace VirtualWorkspace) error {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check if it makes sense to extract common logic on monday.

On-behalf-of: @SAP [email protected]
Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected]
Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected]
Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected]
Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected]
Signed-off-by: Artem Shcherbatiuk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant