K8s: Make GetAPIRoutes an optional interface (#97531)

This commit is contained in:
Ryan McKinley
2024-12-07 03:08:18 +03:00
committed by GitHub
parent f276f9b35d
commit 5f39d2eeb0
15 changed files with 30 additions and 77 deletions
@@ -18,7 +18,12 @@ func GetCustomRoutesHandler(delegateHandler http.Handler, restConfig *restclient
router := mux.NewRouter()
for _, builder := range builders {
routes := builder.GetAPIRoutes()
provider, ok := builder.(APIGroupRouteProvider)
if !ok || provider == nil {
continue
}
routes := provider.GetAPIRoutes()
if routes == nil {
continue
}