-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
…into feat/virtual-workspace
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]>
@@ -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 |
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.
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" { |
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.
I want to improve this code, it looks very bad now.
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.
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 { |
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.
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]>
On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
TBD