Skip to content

Commit

Permalink
fix(controller): unregister legacy namespaced modules when featuregat…
Browse files Browse the repository at this point in the history
…e enabled (#543)

Signed-off-by: Oliver Bähler <[email protected]>
  • Loading branch information
oliverbaehler authored Oct 10, 2024
1 parent 53378c4 commit 206d40f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/webserver/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,10 @@ func (n *kubeFilter) registerModules(ctx context.Context, root *mux.Router) {
runtimeclass.List(n.reader),
persistentvolume.Get(n.reader),
persistentvolume.List(n.reader),
lease.Get(n.reader),
metric.Get(n.reader),
metric.List(n.reader),
tenants.List(),
tenants.Get(n.reader),
pod.Get(n.reader),
}

// Discovery client
Expand Down Expand Up @@ -272,6 +270,11 @@ func (n *kubeFilter) registerModules(ctx context.Context, root *mux.Router) {
n.log.V(6).Info("adding generic namespaced resource", "url", api.Path())
modList = append(modList, namespaced.CatchAll(n.reader, n.writer, api.Path()))
}
} else {
// Register legacy namespaced modules only when featureGate ProxyAllNamespaced is not active.
// This is to avoid registering the same resources twice and having different behaviors on these apis.
modList = append(modList, pod.Get(n.reader))
modList = append(modList, lease.Get(n.reader))
}

for _, i := range modList {
Expand Down

0 comments on commit 206d40f

Please sign in to comment.