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

support to specify enabled controllers #1388

Merged
merged 3 commits into from
Apr 20, 2023

Conversation

xavier-hou
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1379

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

Signed-off-by: hxcGit <houxc_mail@163.com>
@openyurt-bot
Copy link
Collaborator

@xavier-hou: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1379

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot openyurt-bot added the size/L size/L: 100-499 label Apr 18, 2023
@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Merging #1388 (ec017c0) into master (d48450d) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1388      +/-   ##
==========================================
- Coverage   51.88%   51.84%   -0.05%     
==========================================
  Files         124      125       +1     
  Lines       14820    14832      +12     
==========================================
  Hits         7689     7689              
- Misses       6437     6449      +12     
  Partials      694      694              
Flag Coverage Δ
unittests 51.84% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/controller/util/controller_utils.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

pkg/webhook/server.go Outdated Show resolved Hide resolved
@rambohe-ch
Copy link
Member

@xavier-hou some webhooks maybe have not connected controllers, so we need to add a parameter --webhooks for enabling or disabling specified webhooks.

Signed-off-by: hxcGit <houxc_mail@163.com>
@xavier-hou
Copy link
Member Author

@xavier-hou some webhooks maybe have not connected controllers, so we need to add a parameter --webhooks for enabling or disabling specified webhooks.

@rambohe-ch

  1. For contollers who have corresponding webhooks, such as staticpod, if the controller is disabled, then the corresponding webhook will be disabled as well. Because we use a map controllerWebhook to check whether controller has been disabled.
    https://github.com/openyurtio/openyurt/pull/1388/files#diff-c07be401391cf159ca42b3e3c6e8f31d3d0a0a6b1b48998069b64d585a264f35R64
  2. For controllers who don't have corresponding webhooks, then we do nothing.

So I think current PR is enough for enabling and disabling controllers. But If we just want to enable or disable webhooks, then we can add a new parameter --webhooks.

@xavier-hou
Copy link
Member Author

@rambohe-ch We have lots of files aimed at adding controllers to yurt-manager, such as add_csrapprover.go. They are generated by newcontroller command which is convenient for controllers migration but annoying to maintain in the future. How about removing these files and accomplish all controllers register in controller.go?

@rambohe-ch
Copy link
Member

@rambohe-ch We have lots of files aimed at adding controllers to yurt-manager, such as add_csrapprover.go. They are generated by newcontroller command which is convenient for controllers migration but annoying to maintain in the future. How about removing these files and accomplish all controllers register in controller.go?

@xavier-hou I agree your idea to combine these controller files into one file, and i'd like to create a new issue to track this case.

@rambohe-ch
Copy link
Member

@xavier-hou and i will merge this pr at first.

Signed-off-by: hxcGit <houxc_mail@163.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.9% 1.9% Duplication

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rambohe-ch, xavier-hou

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openyurt-bot openyurt-bot added the approved approved label Apr 20, 2023
@rambohe-ch
Copy link
Member

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved lgtm lgtm size/L size/L: 100-499
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request]support enable or disable controllers for yurt-manager
3 participants