@@ -66,6 +66,7 @@ import (
66
66
monv1 "github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring/v1"
67
67
monv1alpha1 "github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring/v1alpha1"
68
68
obov1 "github.com/rhobs/observability-operator/pkg/apis/monitoring/v1alpha1"
69
+ obsui "github.com/rhobs/observability-operator/pkg/apis/uiplugin/v1alpha1"
69
70
)
70
71
71
72
// fields to index to reconcile when change
@@ -634,30 +635,13 @@ func (r *MetricStorageReconciler) createScrapeConfigs(
634
635
635
636
func (r * MetricStorageReconciler ) createDashboardObjects (ctx context.Context , instance * telemetryv1.MetricStorage , eventHandler handler.EventHandler ) (ctrl.Result , error ) {
636
637
Log := r .GetLogger (ctx )
637
- // Deploy dashboard UI plugin from OBO
638
- // TODO: Use the following instead of Unstructured{} after COO 0.2.0
639
- // =====
640
- // uiPluginObj := &obsui.ObservabilityUIPlugin{
641
- // ObjectMeta: metav1.ObjectMeta{
642
- // Name: "dashboards",
643
- // },
644
- // }
645
- // =====
646
- uiPluginObj := & unstructured.Unstructured {}
647
- uiPluginObj .SetUnstructuredContent (map [string ]interface {}{
648
- "spec" : map [string ]interface {}{
649
- "type" : "Dashboards" ,
638
+ uiPluginObj := & obsui.UIPlugin {
639
+ ObjectMeta : metav1.ObjectMeta {
640
+ Name : "dashboards" ,
650
641
},
651
- })
652
- uiPluginObj .SetGroupVersionKind (schema.GroupVersionKind {
653
- Group : "observability.openshift.io" ,
654
- Version : "v1alpha1" ,
655
- Kind : "UIPlugin" ,
656
- })
657
- uiPluginObj .SetName ("dashboards" )
658
- // =====
642
+ }
659
643
op , err := controllerutil .CreateOrPatch (ctx , r .Client , uiPluginObj , func () error {
660
- // uiPluginObj.Spec.Type = "Dashboards" // After we update to COO 0.2.0 as dependency
644
+ uiPluginObj .Spec .Type = "Dashboards"
661
645
return nil
662
646
})
663
647
if err != nil {
0 commit comments