Skip to content

Commit

Permalink
fix: missing watch on prometheusrules from application namespace and …
Browse files Browse the repository at this point in the history
…verb watch on dashboard CR

Signed-off-by: Wen Zhou <[email protected]>
  • Loading branch information
zdtsw committed Nov 19, 2024
1 parent acd89b8 commit 5555f57
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
14 changes: 13 additions & 1 deletion bundle/manifests/opendatahub-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ metadata:
categories: AI/Machine Learning, Big Data
certified: "False"
containerImage: quay.io/opendatahub/opendatahub-operator:v2.19.0
createdAt: "2024-11-01T10:08:53Z"
createdAt: "2024-11-19T13:21:31Z"
olm.skipRange: '>=1.0.0 <2.19.0'
operators.operatorframework.io/builder: operator-sdk-v1.31.0
operators.operatorframework.io/internal-objects: '["featuretrackers.features.opendatahub.io",
Expand Down Expand Up @@ -516,6 +516,7 @@ spec:
- get
- list
- patch
- watch
- apiGroups:
- controller-runtime.sigs.k8s.io
resources:
Expand Down Expand Up @@ -623,6 +624,15 @@ spec:
- dashboard.opendatahub.io
resources:
- acceleratorprofiles
verbs:
- create
- delete
- get
- list
- patch
- apiGroups:
- dashboard.opendatahub.io
resources:
- odhapplications
- odhdocuments
verbs:
Expand All @@ -631,6 +641,7 @@ spec:
- get
- list
- patch
- watch
- apiGroups:
- datasciencecluster.opendatahub.io
resources:
Expand Down Expand Up @@ -869,6 +880,7 @@ spec:
- get
- list
- patch
- watch
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
12 changes: 12 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ rules:
- get
- list
- patch
- watch
- apiGroups:
- controller-runtime.sigs.k8s.io
resources:
Expand Down Expand Up @@ -375,6 +376,15 @@ rules:
- dashboard.opendatahub.io
resources:
- acceleratorprofiles
verbs:
- create
- delete
- get
- list
- patch
- apiGroups:
- dashboard.opendatahub.io
resources:
- odhapplications
- odhdocuments
verbs:
Expand All @@ -383,6 +393,7 @@ rules:
- get
- list
- patch
- watch
- apiGroups:
- datasciencecluster.opendatahub.io
resources:
Expand Down Expand Up @@ -621,6 +632,7 @@ rules:
- get
- list
- patch
- watch
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
8 changes: 4 additions & 4 deletions controllers/datasciencecluster/kubebuilder_rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ package datasciencecluster
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=dashboards/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=dashboards/finalizers,verbs=create;get;list;patch;update;use;watch
// +kubebuilder:rbac:groups="opendatahub.io",resources=odhdashboardconfigs,verbs=create;get;patch;watch;update;delete;list
// +kubebuilder:rbac:groups="console.openshift.io",resources=odhquickstarts,verbs=create;get;patch;list;delete
// +kubebuilder:rbac:groups="dashboard.opendatahub.io",resources=odhdocuments,verbs=create;get;patch;list;delete
// +kubebuilder:rbac:groups="dashboard.opendatahub.io",resources=odhapplications,verbs=create;get;patch;list;delete
// +kubebuilder:rbac:groups="console.openshift.io",resources=odhquickstarts,verbs=create;get;patch;list;delete;watch
// +kubebuilder:rbac:groups="dashboard.opendatahub.io",resources=odhdocuments,verbs=create;get;patch;list;delete;watch
// +kubebuilder:rbac:groups="dashboard.opendatahub.io",resources=odhapplications,verbs=create;get;patch;list;delete;watch
// +kubebuilder:rbac:groups="dashboard.opendatahub.io",resources=acceleratorprofiles,verbs=create;get;patch;list;delete
// +kubebuilder:rbac:groups="user.openshift.io",resources=groups,verbs=get;create;list;watch;patch;delete
// +kubebuilder:rbac:groups="console.openshift.io",resources=consolelinks,verbs=create;get;patch;delete
Expand All @@ -154,7 +154,7 @@ package datasciencecluster
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=kueues,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=kueues/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=kueues/finalizers,verbs=update
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=prometheusrules,verbs=get;create;patch;delete;deletecollection;list
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=prometheusrules,verbs=get;create;patch;delete;deletecollection;list;watch
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=podmonitors,verbs=get;create;delete;update;watch;list;patch

// TODO: CFO
Expand Down
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
userv1 "github.com/openshift/api/user/v1"
ofapiv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
ofapiv2 "github.com/operator-framework/api/pkg/operators/v2"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -111,7 +111,7 @@ func init() { //nolint:gochecknoinits
utilruntime.Must(apiextensionsv1.AddToScheme(scheme))
utilruntime.Must(admissionregistrationv1.AddToScheme(scheme))
utilruntime.Must(apiregistrationv1.AddToScheme(scheme))
utilruntime.Must(monitoringv1.AddToScheme(scheme))
utilruntime.Must(promv1.AddToScheme(scheme))
utilruntime.Must(operatorv1.Install(scheme))
utilruntime.Must(consolev1.AddToScheme(scheme))
utilruntime.Must(securityv1.Install(scheme))
Expand Down Expand Up @@ -232,6 +232,8 @@ func main() { //nolint:funlen,maintidx
},
// for prometheus and black-box deployment and ones we owns
&appsv1.Deployment{}: {Namespaces: deploymentCache},
// kueue need prometheusrules
&promv1.PrometheusRule{}: {Namespaces: deploymentCache},
},
}

Expand Down

0 comments on commit 5555f57

Please sign in to comment.