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

optimize the webhook manager #3588

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vacant2333
Copy link
Contributor

@Vacant2333 Vacant2333 commented Jul 14, 2024

  1. TheForEachAdmission will not tell u if a webhook not register to the manager, i find this problem when i use this manager in my project, and its hard to find

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign k82cn
You can assign the PR to them by writing /assign @k82cn in a comment when ready.

The full list of commands accepted by this bot can be found 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

@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 14, 2024
@Monokaix
Copy link
Member

Hi, please make CI happy.

@Monokaix
Copy link
Member

Monokaix commented Jul 16, 2024

If we remove the existing flags directly, users who upgrade from an old verison meet errors about the flag, so it's not recommended to remove them: )

@Monokaix
Copy link
Member

I think these flags are used to let kube-apiserver know the address of wenhook and access it so we'd better keep them.

@Vacant2333 Vacant2333 force-pushed the optimize-webhook-manager-codes branch from e8ebab2 to 5ea21fd Compare July 19, 2024 03:58
@volcano-sh-bot volcano-sh-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 19, 2024
Signed-off-by: Vacant2333 <vacant2333@gmail.com>
@Vacant2333 Vacant2333 force-pushed the optimize-webhook-manager-codes branch from 5ea21fd to 363be18 Compare July 19, 2024 03:59
@@ -101,7 +102,7 @@ func Run(config *options.Config) error {
}
go func() {
err = server.ListenAndServeTLS("", "")
if err != nil && err != http.ErrServerClosed {
if err != nil && !errors.Is(err, http.ErrServerClosed) {
Copy link
Member

Choose a reason for hiding this comment

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

IMO, this change does not seem to change any logic. Can you explain the benefits of such a change?

@@ -58,6 +58,8 @@ func ForEachAdmission(config *options.Config, handler func(*AdmissionService) er
if err := handler(service); err != nil {
return err
}
} else {
return fmt.Errorf("enabled admission %s not found on the admission registered map", admission)
Copy link
Member

Choose a reason for hiding this comment

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

Why is there an error if admission is not found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants