@@ -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
@@ -633,30 +634,13 @@ func (r *MetricStorageReconciler) createScrapeConfigs(
633
634
634
635
func (r * MetricStorageReconciler ) createDashboardObjects (ctx context.Context , instance * telemetryv1.MetricStorage , eventHandler handler.EventHandler ) (ctrl.Result , error ) {
635
636
Log := r .GetLogger (ctx )
636
- // Deploy dashboard UI plugin from OBO
637
- // TODO: Use the following instead of Unstructured{} after COO 0.2.0
638
- // =====
639
- // uiPluginObj := &obsui.ObservabilityUIPlugin{
640
- // ObjectMeta: metav1.ObjectMeta{
641
- // Name: "dashboards",
642
- // },
643
- // }
644
- // =====
645
- uiPluginObj := & unstructured.Unstructured {}
646
- uiPluginObj .SetUnstructuredContent (map [string ]interface {}{
647
- "spec" : map [string ]interface {}{
648
- "type" : "Dashboards" ,
637
+ uiPluginObj := & obsui.UIPlugin {
638
+ ObjectMeta : metav1.ObjectMeta {
639
+ Name : "dashboards" ,
649
640
},
650
- })
651
- uiPluginObj .SetGroupVersionKind (schema.GroupVersionKind {
652
- Group : "observability.openshift.io" ,
653
- Version : "v1alpha1" ,
654
- Kind : "UIPlugin" ,
655
- })
656
- uiPluginObj .SetName ("dashboards" )
657
- // =====
641
+ }
658
642
op , err := controllerutil .CreateOrPatch (ctx , r .Client , uiPluginObj , func () error {
659
- // uiPluginObj.Spec.Type = "Dashboards" // After we update to COO 0.2.0 as dependency
643
+ uiPluginObj .Spec .Type = "Dashboards"
660
644
return nil
661
645
})
662
646
if err != nil {
0 commit comments