Skip to content

Commit

Permalink
Add client org reconciler
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Nov 12, 2024
1 parent f803f25 commit 6b73c8f
Show file tree
Hide file tree
Showing 11 changed files with 569 additions and 34 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ require (
k8s.io/klog/v2 v2.130.1
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
kmodules.xyz/authorizer v0.29.1
kmodules.xyz/client-go v0.30.32
kmodules.xyz/client-go v0.30.37
kmodules.xyz/custom-resources v0.30.0
kmodules.xyz/monitoring-agent-api v0.30.2
kmodules.xyz/monitoring-agent-api v0.30.3
moul.io/http2curl/v2 v2.3.1-0.20221024080105-10c404f653f7
sigs.k8s.io/controller-runtime v0.18.4
x-helm.dev/apimachinery v0.0.16
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -774,14 +774,14 @@ kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80=
kmodules.xyz/authorizer v0.29.1 h1:uByGGoryKbZcfiEAhjcK/Y345I9mygNQP7DVpkMbNQQ=
kmodules.xyz/authorizer v0.29.1/go.mod h1:kZRhclL8twzyt2bQuJQJbpYww2sc+qFr8I5PPoq/sWY=
kmodules.xyz/client-go v0.30.32 h1:y1qb4IJwYdkROLcc7e0UcJSDj8D2YeLsawAWHnCF+JU=
kmodules.xyz/client-go v0.30.32/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/client-go v0.30.37 h1:hj4BMsNDgRVc2aDPB6Y3x5iCylXTZDZeQPJp/oA6lxs=
kmodules.xyz/client-go v0.30.37/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/crd-schema-fuzz v0.29.1 h1:zJTlWYOrT5dsVVHW8HGcnR/vaWfxQfNh11QwTtkYpcs=
kmodules.xyz/crd-schema-fuzz v0.29.1/go.mod h1:n708z9YQqLMP2KNLQVgBcRJw1QpSWLvpNCEi+KJDOYE=
kmodules.xyz/custom-resources v0.30.0 h1:vR3CbseHMLwR4GvtcJJuRuwIV8voKqFqNii27rMcm1o=
kmodules.xyz/custom-resources v0.30.0/go.mod h1:ZsTuI2mLG2s3byre7bHmpxJ9w0HDqAkRTL1+izGFI24=
kmodules.xyz/monitoring-agent-api v0.30.2 h1:sAgz5P5EXZqhlj1NzJ+QltAgeIx5bGSMj+aYy2EiKaw=
kmodules.xyz/monitoring-agent-api v0.30.2/go.mod h1:BoZFPDDRB7J39CcUsSDlzgW8PQCwik4ILPleyUob+Mg=
kmodules.xyz/monitoring-agent-api v0.30.3 h1:DVGwcRvtaTmRA7Wj4PJ5xR5ADzLo/IB3X2XmAJikbEo=
kmodules.xyz/monitoring-agent-api v0.30.3/go.mod h1:L586zE2BvTQeOmf7VHkuBY+QM1UWGdNzwyVJDtVcZsI=
moul.io/http2curl/v2 v2.3.1-0.20221024080105-10c404f653f7 h1:NykkTlRB+X40z86cLHdEmuoTxhNKhQebLT379b1EumA=
moul.io/http2curl/v2 v2.3.1-0.20221024080105-10c404f653f7/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
12 changes: 12 additions & 0 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"go.openviz.dev/apimachinery/apis/ui"
uiinstall "go.openviz.dev/apimachinery/apis/ui/install"
uiapi "go.openviz.dev/apimachinery/apis/ui/v1alpha1"
namespacecontroller "go.openviz.dev/grafana-tools/pkg/controllers/namespace"
promtehsucontroller "go.openviz.dev/grafana-tools/pkg/controllers/prometheus"
"go.openviz.dev/grafana-tools/pkg/controllers/ranchertoken"
servicemonitorcontroller "go.openviz.dev/grafana-tools/pkg/controllers/servicemonitor"
Expand Down Expand Up @@ -202,6 +203,17 @@ func (c completedConfig) New(ctx context.Context) (*UIServer, error) {
Group: monitoring.GroupName,
Kind: monitoringv1.PrometheusesKind,
}, func(ctx context.Context, mgr ctrl.Manager) {
if err = namespacecontroller.NewReconciler(
mgr.GetClient(),
bc,
cid,
c.ExtraConfig.HubUID,
d,
).SetupWithManager(mgr); err != nil {
klog.Error(err, "unable to create controller", "controller", "ClientOrg")
os.Exit(1)
}

if err = promtehsucontroller.NewReconciler(
mgr.GetClient(),
bc,
Expand Down
Loading

0 comments on commit 6b73c8f

Please sign in to comment.