-
Notifications
You must be signed in to change notification settings - Fork 394
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
✨ Add workspace mount battery & controller #3058
✨ Add workspace mount battery & controller #3058
Conversation
Skipping CI for Draft Pull Request. |
40cac1b
to
3569612
Compare
01c282a
to
1fd5801
Compare
1bcd6f8
to
e06a30b
Compare
pkg/reconciler/tenancy/workspacemounts/workspace_controller_gvk.go
Outdated
Show resolved
Hide resolved
pkg/reconciler/tenancy/workspacemounts/workspace_controller_gvk.go
Outdated
Show resolved
Hide resolved
@sttts updated |
pkg/reconciler/tenancy/workspacemounts/workspacemounts_controller_workspaces.go
Outdated
Show resolved
Hide resolved
// workspace based on the mount status. | ||
func (c *Controller) reconcile(ctx context.Context, ws *tenancyv1alpha1.Workspace) (bool, error) { | ||
getMountObjectFunc := func(ctx context.Context, cluster logicalcluster.Path, ref *v1.ObjectReference) (*unstructured.Unstructured, error) { | ||
resourceName := strings.ToLower(ref.Kind) + "s" |
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.
should we maybe reference resources? This logic here will break if somebody has custom plural.
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 was trying to avoid hardcoding and make a generic one.
Alternative is either hardcode in the core, which I tried to avoid so code does not need to be changed when new mount implementation is done.
Not sure if there is another easy'ish alternative?
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.
Idea was if you use Plural already - that's kinda wrong naming
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.
true. This really needs a rest mapper, but a per-workspace rest mapper is also ugly 🤔
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 think this gives us a path forward, for now, we can change this later while we iterate.
pkg/reconciler/tenancy/workspacemounts/workspacemounts_reconcile_updater.go
Outdated
Show resolved
Hide resolved
pkg/reconciler/tenancy/workspacemounts/workspacemounts_controller_workspaces.go
Outdated
Show resolved
Hide resolved
pkg/reconciler/tenancy/workspacemounts/workspacemounts_controller_workspaces.go
Outdated
Show resolved
Hide resolved
pkg/reconciler/tenancy/workspacemounts/workspacemounts_controller_workspaces.go
Outdated
Show resolved
Hide resolved
7ad1b7c
to
b99e2db
Compare
pkg/reconciler/tenancy/workspacemounts/workspacemounts_controller_gvk.go
Outdated
Show resolved
Hide resolved
pkg/reconciler/tenancy/workspacemounts/workspacemounts_controller_workspaces.go
Outdated
Show resolved
Hide resolved
874c3f9
to
ba8474b
Compare
Signed-off-by: Mangirdas Judeikis <[email protected]>
ba8474b
to
8ed8e3d
Compare
/hold |
…ys in queue Signed-off-by: Dr. Stefan Schimanski <[email protected]>
return false, nil | ||
} | ||
|
||
workspaceOwnerRaw, ok := u.GetAnnotations()[tenancyv1alpha1.ExperimentalWorkspaceOwnerAnnotationKey] |
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.
the use of this annotation irritates me. We usually use it to store the userInfo of the user that created a workspace.
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.
should we add a dedicated one?
experimental.tenancy.kcp.io/owning-workspace
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.
agreed. lets move to index post kubecon? Else I need to redo our demo env :D
reconciler/tenancy/workspacemounts: simplify with only one type of keys in queue
Clearly experimental. We will come back. /lgtm |
LGTM label has been added. Git tree hash: 5417454bcf0bc370dc38501c0d574a1b50d0cf6a
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-kcp-test-e2e-shared |
/hold cancel |
Summary
Add workspace mounts battery and loose coupling controller which checks workspace annotations, dynamically watches mount objects, and updates workspace annotations accordingly with updated status
Related issue(s)
Fixes #
Release Notes