Skip to content
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

2. Plumb LogicalCluster type through and generalize lcluster logic #744

Merged
merged 10 commits into from
Mar 28, 2022

Conversation

sttts
Copy link
Member

@sttts sttts commented Mar 18, 2022

Based on https://github.com/kcp-dev/apimachinery/blob/main/pkg/logicalcluster/logicalcluster.go.

In general, this PR implements the ideas of https://docs.google.com/document/d/1XJJCr16bg22QuJnQB2W98A-djRTtrLr2JE2IWZUHzJU/edit#heading=h.nn8danthd1ys.

Depends on kcp-dev/kubernetes#53.

Bildschirmfoto 2022-03-21 um 14 12 13

@sttts sttts force-pushed the sttts-kcp-logicalcluster branch 9 times, most recently from f680a35 to ea3dfd2 Compare March 20, 2022 17:01
@marun
Copy link
Contributor

marun commented Mar 21, 2022

abstract logical cluster retrival from objects (to prepare for deprecation of metadata.clusterName)

Any pointers to the why and how of this deprecation? This is the first I'm hearing of it, and the existing code seems to heavily depend on the existing field.

@marun
Copy link
Contributor

marun commented Mar 22, 2022

Would it be possible to break this into smaller pieces to make detailed review a possibility?

@sttts sttts force-pushed the sttts-kcp-logicalcluster branch 3 times, most recently from 94273bf to dfa03d6 Compare March 24, 2022 21:59
@sttts sttts changed the title WIP: Plumb github.com/kcp-dev/kcp LogicalCluster type through Plumb github.com/kcp-dev/kcp LogicalCluster type through Mar 25, 2022
@sttts sttts changed the title Plumb github.com/kcp-dev/kcp LogicalCluster type through Plumb LogicalCluster type through and generalize lcluster logic Mar 25, 2022
} else if decision != authorizer.DecisionAllow {
return kerrors.NewForbidden(tenancyv1beta1.Resource("workspaces"), "", fmt.Errorf("user %q lacks %s permission to workspace %q", user.GetName(), verb, orgClusterName))
klog.Errorf("user %q lacks (%s) clusterworkspaces/content %q permission for %q in %s: %s", user.GetName(), decisions[decision], verb, orgName, parent, reason)
Copy link
Contributor

Choose a reason for hiding this comment

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

general thought: does this already land in audit?

Copy link
Member Author

Choose a reason for hiding this comment

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

good question. I don't know how it could. We cannot return a detailed error object. Is there some way to give annotations to the audit layer?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, i believe so 🤔 let me look at that.

@sttts sttts force-pushed the sttts-kcp-logicalcluster branch 3 times, most recently from e2ebac3 to ec8a094 Compare March 25, 2022 17:07
@sttts sttts modified the milestones: Prototype 3, Prototype 4 Mar 25, 2022
@sttts sttts force-pushed the sttts-kcp-logicalcluster branch 3 times, most recently from f57494b to 5034d72 Compare March 25, 2022 21:39
@sttts sttts requested a review from davidfestal March 25, 2022 21:55
Copy link
Contributor

@marun marun left a comment

Choose a reason for hiding this comment

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

There are at least 4 orthogonal concerns represented in this PR:

  • logical cluster type
  • changes to virtual workspaces
  • changes to auth
  • new 'team' workspace

Maybe submit these changes separately so they can be reviewed with the rigor they deserve?

Makefile Outdated Show resolved Hide resolved
cmd/kubectl-workspaces/main.go Outdated Show resolved Hide resolved
cmd/kubectl-ws/main.go Outdated Show resolved Hide resolved
pkg/apis/tenancy/v1alpha1/types.go Show resolved Hide resolved
pkg/authorization/toplevel_org_authorizer.go Outdated Show resolved Hide resolved
pkg/server/apiextensions.go Outdated Show resolved Hide resolved
pkg/server/apiextensions.go Outdated Show resolved Hide resolved
pkg/server/controllers.go Outdated Show resolved Hide resolved
pkg/server/handler.go Show resolved Hide resolved
@sttts sttts force-pushed the sttts-kcp-logicalcluster branch 2 times, most recently from d3d6027 to 468b1d5 Compare March 26, 2022 09:02
@sttts sttts changed the title Plumb LogicalCluster type through and generalize lcluster logic 2. Plumb LogicalCluster type through and generalize lcluster logic Mar 26, 2022
@sttts sttts force-pushed the sttts-kcp-logicalcluster branch 4 times, most recently from f605594 to a74ceff Compare March 26, 2022 16:26
Copy link
Contributor

@marun marun left a comment

Choose a reason for hiding this comment

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

LGTM

@sttts sttts enabled auto-merge March 27, 2022 09:50
@sttts sttts disabled auto-merge March 27, 2022 09:51
@sttts sttts merged commit 6fa12d5 into kcp-dev:main Mar 28, 2022
@sttts sttts deleted the sttts-kcp-logicalcluster branch March 28, 2022 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/authorization area/logical-cluster Related to logical clusters area/server Everything around `kcp start` area/sharding Issues or PRs related to sharding changes area/workspaces kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants