Skip to content

Commit

Permalink
reduce watched ressources
Browse files Browse the repository at this point in the history
  • Loading branch information
christianwoehrle committed Sep 21, 2022
1 parent 780be13 commit 05b48b4
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions pkg/controller/keycloak/keycloak_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ import (

"github.com/christianwoehrle/keycloakclient-operator/version"

v1beta12 "k8s.io/api/policy/v1beta1"

"k8s.io/client-go/tools/record"
"sigs.k8s.io/controller-runtime/pkg/controller"

monitoringv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
grafanav1alpha1 "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"

"github.com/christianwoehrle/keycloakclient-operator/pkg/apis/keycloak/v1alpha1"
Expand All @@ -22,7 +17,6 @@ import (
"github.com/christianwoehrle/keycloakclient-operator/pkg/common"
"github.com/pkg/errors"

networkingv1 "k8s.io/api/networking/v1"
kubeerrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -80,42 +74,6 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, common.StatefulSetKind, &appsv1.StatefulSet{}, &kc.Keycloak{}); err != nil {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, common.ServiceKind, &corev1.Service{}, &kc.Keycloak{}); err != nil {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, common.IngressKind, &networkingv1.Ingress{}, &kc.Keycloak{}); err != nil {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, common.DeploymentKind, &appsv1.Deployment{}, &kc.Keycloak{}); err != nil {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, common.PersistentVolumeClaimKind, &corev1.PersistentVolumeClaim{}, &kc.Keycloak{}); err != nil {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, common.PodDisruptionBudgetKind, &v1beta12.PodDisruptionBudget{}, &kc.Keycloak{}); err != nil {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, monitoringv1.PrometheusRuleKind, &monitoringv1.PrometheusRule{}, &kc.Keycloak{}); err != nil {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, monitoringv1.ServiceMonitorsKind, &monitoringv1.ServiceMonitor{}, &kc.Keycloak{}); err != nil {
return err
}

if err := common.WatchSecondaryResource(c, ControllerName, grafanav1alpha1.GrafanaDashboardKind, &grafanav1alpha1.GrafanaDashboard{}, &kc.Keycloak{}); err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit 05b48b4

Please sign in to comment.