Repository: kubernetes/kubernetes (language: go)

Issue:
duplicate init kube-apiserver gorestful.container.ServeMux
### What happened?

https://github.com/kubernetes/kubernetes/blob/00236ae0d73d2455a2470469ed1005674f8ed61f/staging/src/k8s.io/apiserver/pkg/server/handler.go#L80
https://github.com/emicklei/go-restful/blob/33de94869dbe48c2ad3bba44083546d0672fc359/container.go#L39

### What did you expect to happen?

whether should init gorestful.container.ServeMux once

### How can we reproduce it (as minimally and precisely as possible)?

none

### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$ kubectl version
# paste output here
```

</details>


### Cloud provider

<details>

</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>



Discussion / hints:
/sig api-machinery

/assign @Jefftree 
/triage accepted
Hi @Jerry-yz , as for my understanding, func 'NewAPIServerHandler' initialize gorestfulContainer.ServeMux each time due to  gorestfulContainer.ServeMux = http.NewServeMux() when the function is called ,am i right ?
Looks like it is duplicated and we should be able to remove the call. Feel free to assign if anyone would like to send a PR for this.
I want to work on this but need to some guidance 
> Hi @Jerry-yz , as for my understanding, func 'NewAPIServerHandler' initialize gorestfulContainer.ServeMux each time due to gorestfulContainer.ServeMux = http.NewServeMux() when the function is called ,am i right ?

Yes, and it should already have been initialized when calling `restful.NewContainer()`
yes @Jefftree got it , so we can remove call gorestfulContainer.ServeMux = http.NewServeMux() ?
yes
/assign @Adarsh-verma-14 
I will raised PR.

Fix patch:
diff --git a/staging/src/k8s.io/apiserver/pkg/server/handler.go b/staging/src/k8s.io/apiserver/pkg/server/handler.go
index 847a624e36b9a..b829ade745cc1 100644
--- a/staging/src/k8s.io/apiserver/pkg/server/handler.go
+++ b/staging/src/k8s.io/apiserver/pkg/server/handler.go
@@ -77,7 +77,6 @@ func NewAPIServerHandler(name string, s runtime.NegotiatedSerializer, handlerCha
 	}
 
 	gorestfulContainer := restful.NewContainer()
-	gorestfulContainer.ServeMux = http.NewServeMux()
 	gorestfulContainer.Router(restful.CurlyRouter{}) // e.g. for proxy/{kind}/{name}/{*}
 	gorestfulContainer.RecoverHandler(func(panicReason interface{}, httpWriter http.ResponseWriter) {
 		logStackOnRecover(s, panicReason, httpWriter)


Test patch: