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

feat: add operationrequest for multi-namespace and update user controller. #3595

Merged
merged 14 commits into from Aug 21, 2023

Conversation

lingdie
Copy link
Collaborator

@lingdie lingdie commented Jul 27, 2023

🤖 Generated by Copilot at 88a0c41

Summary

📝🛠️🚀

This pull request adds a new API resource Operationrequest to the user controller, which allows end users to request operations on their user resources, such as granting or depriving roles. The pull request also adds webhooks, CRD patches, RBAC roles, and samples for the new resource, and fixes some typos and inconsistencies in the existing code.

We are the masters of operation
We control the users and their roles
We unleash the power of webhooks
We mutate and validate our souls

Walkthrough

  • Add a new API resource Operationrequest with the group user, the version v1, and the domain sealos.io (link)
  • Define the Go types for the Operationrequest resource, including the spec, status, and some constants and enums (link)
  • Generate the CRD manifest for the Operationrequest resource, with the kubebuilder annotations and schema (link)
  • Define the webhooks for the Operationrequest resource, including the defaulting, validating, and conversion logic (link)
  • Generate the webhook configuration and registration for the Operationrequest resource, with the kubebuilder annotations and client config (link, link, link)
  • Define the cluster roles for end users to edit and view operation requests, with the permissions to access the resource and its status (link, link)
  • Add the permissions for the controller to access the Operationrequest resource and its finalizers and status to the role (link)
  • Set up the webhooks for the Operationrequest resource with the controller manager, and enable them in the test environment ( link)
  • Define some sample operation requests for testing purposes, to grant and deprive the owner role to a user in a namespace (link)
  • Add a patch for the cert-manager CA injection for the Operationrequest resource, and reference it in the kustomization file (link, link)
  • Modify the user_types.go file, to remove a scaffolding comment, fix a typo, and rename the UserRoleType type to RoleType (link, link, link)
  • Fix the same typo in the CRD manifest for the User resource (link)
  • Modify the sample users for testing purposes, to add some annotations and names, and define a group user (link)
  • Delete the sample user group and user group binding files, as they are no longer needed (link, link)
  • Modify the Makefile, to add a variable for the target architecture, add some dependencies to the build target, and modify the docker build target to use the target architecture (link, link, link)

geniuxy and others added 9 commits July 26, 2023 20:34
* feat: expose mongo uri. (labring#3586)

* expose mongo uri env.

* feat: operation request -> rolebinding (sa <-> role)

* feat: operation request -> rolebinding (sa <-> role)

* feat: operation request

---------

Co-authored-by: yy <56745951+lingdie@users.noreply.github.com>
@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Jul 27, 2023

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 909
✅ Successful 372
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 536
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (2b94328) 66.36% compared to head (18c4922) 66.36%.

❗ Current head 18c4922 differs from pull request most recent head 95e6e5a. Consider uploading reports for the commit 95e6e5a to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3595   +/-   ##
=======================================
  Coverage   66.36%   66.36%           
=======================================
  Files           8        8           
  Lines         654      654           
=======================================
  Hits          434      434           
  Misses        173      173           
  Partials       47       47           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pull-request-size
Copy link

Whoa! Easy there, Partner!

This PR is too big. Please break it up into smaller PRs.

@cuisongliu cuisongliu marked this pull request as draft August 9, 2023 13:43
@lingdie lingdie marked this pull request as ready for review August 21, 2023 08:27
@lingdie lingdie merged commit db209d4 into labring:main Aug 21, 2023
23 of 25 checks passed
@lingdie lingdie deleted the user branch August 21, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants