Skip to content

Commit

Permalink
enhancement and add namespace and projectID to endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadhamzh committed Feb 7, 2025
1 parent ea2458e commit 1d31eab
Show file tree
Hide file tree
Showing 88 changed files with 10,486 additions and 410 deletions.
14 changes: 14 additions & 0 deletions modules/api/cmd/kubermatic-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
gatekeeperconfigv1alpha1 "github.com/open-policy-agent/gatekeeper/v3/apis/config/v1alpha1"
prometheusapi "github.com/prometheus/client_golang/api"
velerov1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
Expand Down Expand Up @@ -94,6 +95,7 @@ import (
"k8s.io/metrics/pkg/apis/metrics/v1beta1"
ctrlruntime "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
ctrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client"
ctrlruntimelog "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
Expand Down Expand Up @@ -140,6 +142,10 @@ func main() {
log.Fatalw("failed to register scheme", zap.Stringer("api", velerov1.SchemeGroupVersion), zap.Error(err))
}

if err := kyvernov1.AddToScheme(scheme.Scheme); err != nil {
log.Fatalw("failed to register scheme", zap.Stringer("api", kyvernov1.SchemeGroupVersion), zap.Error(err))
}

if err := kubeovnv1.AddToScheme(scheme.Scheme); err != nil {
log.Fatalw("failed to register scheme", zap.Stringer("api", kubeovnv1.SchemeGroupVersion), zap.Error(err))
}
Expand All @@ -156,6 +162,14 @@ func main() {
DefaultNamespaces: map[string]cache.Config{
options.namespace: {},
},
ByObject: map[ctrlruntimeclient.Object]cache.ByObject{
&kubermaticv1.PolicyBinding{}: {
// Cache PolicyBinding across all namespaces.
Namespaces: map[string]cache.Config{
cache.AllNamespaces: {},
},
},
},
},
BaseContext: func() context.Context {
return ctx
Expand Down
Loading

0 comments on commit 1d31eab

Please sign in to comment.