Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
Signed-off-by: Vacant2333 <vacant2333@gmail.com>
  • Loading branch information
Vacant2333 committed Jul 19, 2024
1 parent 8141f1f commit 363be18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/webhook-manager/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package app

import (
"errors"
"fmt"
"net/http"
"os"
Expand Down Expand Up @@ -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) {
klog.Fatalf("ListenAndServeTLS for admission webhook failed: %v", err)
close(webhookServeError)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/webhooks/router/admission.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
return nil
Expand Down

0 comments on commit 363be18

Please sign in to comment.