diff --git a/controllers/dashboard_controller.go b/controllers/dashboard_controller.go index 6b49728ed..fd8a17976 100644 --- a/controllers/dashboard_controller.go +++ b/controllers/dashboard_controller.go @@ -750,14 +750,7 @@ func (r *GrafanaDashboardReconciler) UpdateHomeDashboard(ctx context.Context, gr return err } - p, err := grafanaClient.OrgPreferences() - if err != nil { - r.Log.Error(err, "unable to fetch org preferences", "namespace", dashboard.Namespace, "name", dashboard.Name) - return err - } - - p.HomeDashboardUID = uid - _, err = grafanaClient.UpdateAllOrgPreferences(p) + _, err = grafanaClient.UpdateOrgPreferences(grapi.Preferences{HomeDashboardUID: uid}) if err != nil { r.Log.Error(err, "unable to update the home dashboard", "namespace", dashboard.Namespace, "name", dashboard.Name) return err diff --git a/go.mod b/go.mod index 7890f59de..251a97f75 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/go-logr/logr v1.3.0 github.com/google/go-jsonnet v0.20.0 - github.com/grafana/grafana-api-golang-client v0.26.0 + github.com/grafana/grafana-api-golang-client v0.27.0 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.30.0 github.com/openshift/api v3.9.0+incompatible diff --git a/go.sum b/go.sum index 190110617..3122f69ce 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJY github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grafana/grafana-api-golang-client v0.26.0 h1:Eu2YsfUezYngy8ifvmLybgluIcn/2IS9u1xkzuYstEM= -github.com/grafana/grafana-api-golang-client v0.26.0/go.mod h1:uNLZEmgKtTjHBtCQMwNn3qsx2mpMb8zU+7T4Xv3NR9Y= +github.com/grafana/grafana-api-golang-client v0.27.0 h1:zIwMXcbCB4n588i3O2N6HfNcQogCNTd/vPkEXTr7zX8= +github.com/grafana/grafana-api-golang-client v0.27.0/go.mod h1:uNLZEmgKtTjHBtCQMwNn3qsx2mpMb8zU+7T4Xv3NR9Y= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=