diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 25a1b9c59..f27324c87 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -4,12 +4,12 @@ import ( "context" "flag" "fmt" - "github.com/integr8ly/grafana-operator/pkg/apis" - "github.com/integr8ly/grafana-operator/pkg/controller" - "github.com/integr8ly/grafana-operator/pkg/controller/common" - config2 "github.com/integr8ly/grafana-operator/pkg/controller/config" - "github.com/integr8ly/grafana-operator/pkg/controller/grafanadashboard" - "github.com/integr8ly/grafana-operator/version" + "github.com/integr8ly/grafana-operator/v3/pkg/apis" + "github.com/integr8ly/grafana-operator/v3/pkg/controller" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/common" + config2 "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/grafanadashboard" + "github.com/integr8ly/grafana-operator/v3/version" routev1 "github.com/openshift/api/route/v1" "github.com/operator-framework/operator-sdk/pkg/k8sutil" "github.com/operator-framework/operator-sdk/pkg/leader" diff --git a/go.mod b/go.mod index 2460be67e..620de8f60 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/integr8ly/grafana-operator +module github.com/integr8ly/grafana-operator/v3 go 1.13 diff --git a/pkg/apis/addtoscheme_integreatly_v1alpha1.go b/pkg/apis/addtoscheme_integreatly_v1alpha1.go index fca75e0e8..c663f9d71 100644 --- a/pkg/apis/addtoscheme_integreatly_v1alpha1.go +++ b/pkg/apis/addtoscheme_integreatly_v1alpha1.go @@ -1,7 +1,7 @@ package apis import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" ) func init() { diff --git a/pkg/controller/add_datasource.go b/pkg/controller/add_datasource.go index 6badf9748..6afe96dc8 100644 --- a/pkg/controller/add_datasource.go +++ b/pkg/controller/add_datasource.go @@ -1,7 +1,7 @@ package controller import ( - "github.com/integr8ly/grafana-operator/pkg/controller/grafanadatasource" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/grafanadatasource" ) func init() { diff --git a/pkg/controller/add_grafana.go b/pkg/controller/add_grafana.go index b22cf2299..770f630b6 100644 --- a/pkg/controller/add_grafana.go +++ b/pkg/controller/add_grafana.go @@ -1,7 +1,7 @@ package controller import ( - "github.com/integr8ly/grafana-operator/pkg/controller/grafana" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/grafana" ) func init() { diff --git a/pkg/controller/common/auto_detect.go b/pkg/controller/common/auto_detect.go index 978022f74..9019b1d80 100644 --- a/pkg/controller/common/auto_detect.go +++ b/pkg/controller/common/auto_detect.go @@ -1,7 +1,7 @@ package common import ( - config2 "github.com/integr8ly/grafana-operator/pkg/controller/config" + config2 "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" "k8s.io/apimachinery/pkg/runtime/schema" "time" diff --git a/pkg/controller/common/clusterState.go b/pkg/controller/common/clusterState.go index 09488ffa9..e2cb679d3 100644 --- a/pkg/controller/common/clusterState.go +++ b/pkg/controller/common/clusterState.go @@ -2,9 +2,9 @@ package common import ( "context" - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/config" - "github.com/integr8ly/grafana-operator/pkg/controller/model" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/model" v12 "github.com/openshift/api/route/v1" v13 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" diff --git a/pkg/controller/common/dataSourcesState.go b/pkg/controller/common/dataSourcesState.go index 6690f7add..66d3a2dce 100644 --- a/pkg/controller/common/dataSourcesState.go +++ b/pkg/controller/common/dataSourcesState.go @@ -2,8 +2,8 @@ package common import ( "context" - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/model" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/model" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/controller/config/controller_config.go b/pkg/controller/config/controller_config.go index 67d6a0666..fce0aa160 100644 --- a/pkg/controller/config/controller_config.go +++ b/pkg/controller/config/controller_config.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" ) diff --git a/pkg/controller/config/grafanaIni.go b/pkg/controller/config/grafanaIni.go index 854b6ed66..0a888e319 100644 --- a/pkg/controller/config/grafanaIni.go +++ b/pkg/controller/config/grafanaIni.go @@ -3,7 +3,7 @@ package config import ( "crypto/md5" "fmt" - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" "io" "sort" "strings" diff --git a/pkg/controller/grafana/grafana_controller.go b/pkg/controller/grafana/grafana_controller.go index 91fa99a63..7fbd900e1 100644 --- a/pkg/controller/grafana/grafana_controller.go +++ b/pkg/controller/grafana/grafana_controller.go @@ -4,10 +4,10 @@ import ( "context" stdErr "errors" "fmt" - i8ly "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/common" - "github.com/integr8ly/grafana-operator/pkg/controller/config" - "github.com/integr8ly/grafana-operator/pkg/controller/model" + grafanav1alpha1 "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/common" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/model" routev1 "github.com/openshift/api/route/v1" v12 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" @@ -61,7 +61,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler, autodetectChannel chan sch } // Watch for changes to primary resource Grafana - err = c.Watch(&source.Kind{Type: &i8ly.Grafana{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(&source.Kind{Type: &grafanav1alpha1.Grafana{}}, &handler.EnqueueRequestForObject{}) if err != nil { return err } @@ -128,14 +128,14 @@ type ReconcileGrafana struct { func watchSecondaryResource(c controller.Controller, resource runtime.Object) error { return c.Watch(&source.Kind{Type: resource}, &handler.EnqueueRequestForOwner{ IsController: true, - OwnerType: &i8ly.Grafana{}, + OwnerType: &grafanav1alpha1.Grafana{}, }) } // Reconcile reads that state of the cluster for a Grafana object and makes changes based on the state read // and what is in the Grafana.Spec func (r *ReconcileGrafana) Reconcile(request reconcile.Request) (reconcile.Result, error) { - instance := &i8ly.Grafana{} + instance := &grafanav1alpha1.Grafana{} err := r.client.Get(r.context, request.NamespacedName, instance) if err != nil { if errors.IsNotFound(err) { @@ -176,9 +176,9 @@ func (r *ReconcileGrafana) Reconcile(request reconcile.Request) (reconcile.Resul return r.manageSuccess(cr, currentState) } -func (r *ReconcileGrafana) manageError(cr *i8ly.Grafana, issue error) (reconcile.Result, error) { +func (r *ReconcileGrafana) manageError(cr *grafanav1alpha1.Grafana, issue error) (reconcile.Result, error) { r.recorder.Event(cr, "Warning", "ProcessingError", issue.Error()) - cr.Status.Phase = i8ly.PhaseFailing + cr.Status.Phase = grafanav1alpha1.PhaseFailing cr.Status.Message = issue.Error() err := r.client.Status().Update(r.context, cr) @@ -200,7 +200,7 @@ func (r *ReconcileGrafana) manageError(cr *i8ly.Grafana, issue error) (reconcile } // Try to find a suitable url to grafana -func (r *ReconcileGrafana) getGrafanaAdminUrl(cr *i8ly.Grafana, state *common.ClusterState) (string, error) { +func (r *ReconcileGrafana) getGrafanaAdminUrl(cr *grafanav1alpha1.Grafana, state *common.ClusterState) (string, error) { // If preferService is true, we skip the routes and try to access grafana // by using the serivce. preferService := false @@ -238,8 +238,8 @@ func (r *ReconcileGrafana) getGrafanaAdminUrl(cr *i8ly.Grafana, state *common.Cl return "", stdErr.New("failed to find admin url") } -func (r *ReconcileGrafana) manageSuccess(cr *i8ly.Grafana, state *common.ClusterState) (reconcile.Result, error) { - cr.Status.Phase = i8ly.PhaseReconciling +func (r *ReconcileGrafana) manageSuccess(cr *grafanav1alpha1.Grafana, state *common.ClusterState) (reconcile.Result, error) { + cr.Status.Phase = grafanav1alpha1.PhaseReconciling cr.Status.Message = "success" // Only update the status if the dashboard controller had a chance to sync the cluster @@ -249,7 +249,7 @@ func (r *ReconcileGrafana) manageSuccess(cr *i8ly.Grafana, state *common.Cluster } else { r.config.SetDashboards(cr.Status.InstalledDashboards) if r.config.Dashboards == nil { - r.config.SetDashboards(make(map[string][]*i8ly.GrafanaDashboardRef)) + r.config.SetDashboards(make(map[string][]*grafanav1alpha1.GrafanaDashboardRef)) } } diff --git a/pkg/controller/grafana/grafana_reconciler.go b/pkg/controller/grafana/grafana_reconciler.go index 48923b8b5..b73fd0c31 100644 --- a/pkg/controller/grafana/grafana_reconciler.go +++ b/pkg/controller/grafana/grafana_reconciler.go @@ -2,10 +2,10 @@ package grafana import ( "fmt" - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/common" - "github.com/integr8ly/grafana-operator/pkg/controller/config" - "github.com/integr8ly/grafana-operator/pkg/controller/model" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/common" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/model" ) type GrafanaReconciler struct { diff --git a/pkg/controller/grafana/pluginsHelper.go b/pkg/controller/grafana/pluginsHelper.go index b407369b2..318081901 100644 --- a/pkg/controller/grafana/pluginsHelper.go +++ b/pkg/controller/grafana/pluginsHelper.go @@ -3,8 +3,8 @@ package grafana import ( "crypto/tls" "fmt" - integreatly "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/config" + grafanav1alpha1 "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" "net/http" "strings" ) @@ -28,7 +28,7 @@ func newPluginsHelper() *PluginsHelperImpl { // Query the Grafana plugin database for the given plugin and version // A 200 OK response indicates that the plugin exists and can be downloaded -func (h *PluginsHelperImpl) PluginExists(plugin integreatly.GrafanaPlugin) bool { +func (h *PluginsHelperImpl) PluginExists(plugin grafanav1alpha1.GrafanaPlugin) bool { url := fmt.Sprintf(h.BaseUrl, plugin.Name, plugin.Version) resp, err := h.HttpClient.Get(url) if err != nil { @@ -46,7 +46,7 @@ func (h *PluginsHelperImpl) PluginExists(plugin integreatly.GrafanaPlugin) bool // Turns an array of plugins into a string representation of the form // `:,...` that is used as the value for the GRAFANA_PLUGINS // environment variable -func (h *PluginsHelperImpl) BuildEnv(cr *integreatly.Grafana) string { +func (h *PluginsHelperImpl) BuildEnv(cr *grafanav1alpha1.Grafana) string { var env []string for _, plugin := range cr.Status.InstalledPlugins { env = append(env, fmt.Sprintf("%s:%s", plugin.Name, plugin.Version)) @@ -55,8 +55,8 @@ func (h *PluginsHelperImpl) BuildEnv(cr *integreatly.Grafana) string { } // Append a status message to the origin dashboard of a plugin -func (h *PluginsHelperImpl) pickLatestVersions(requested integreatly.PluginList) (integreatly.PluginList, error) { - var latestVersions integreatly.PluginList +func (h *PluginsHelperImpl) pickLatestVersions(requested grafanav1alpha1.PluginList) (grafanav1alpha1.PluginList, error) { + var latestVersions grafanav1alpha1.PluginList for _, plugin := range requested { result, err := requested.HasNewerVersionOf(&plugin) @@ -78,8 +78,8 @@ func (h *PluginsHelperImpl) pickLatestVersions(requested integreatly.PluginList) // Creates the list of plugins that can be added or updated // Does not directly deal with removing plugins: if a plugin is not in the list and the env var is updated, it will // automatically be removed -func (h *PluginsHelperImpl) FilterPlugins(cr *integreatly.Grafana, requested integreatly.PluginList) (integreatly.PluginList, bool) { - filteredPlugins := integreatly.PluginList{} +func (h *PluginsHelperImpl) FilterPlugins(cr *grafanav1alpha1.Grafana, requested grafanav1alpha1.PluginList) (grafanav1alpha1.PluginList, bool) { + filteredPlugins := grafanav1alpha1.PluginList{} pluginsUpdated := false // Try to pick the latest versions of all plugins diff --git a/pkg/controller/grafana/pluginsHelper_test.go b/pkg/controller/grafana/pluginsHelper_test.go index fb8f3d397..e1f586c2e 100644 --- a/pkg/controller/grafana/pluginsHelper_test.go +++ b/pkg/controller/grafana/pluginsHelper_test.go @@ -1,7 +1,7 @@ package grafana import ( - testing2 "github.com/integr8ly/grafana-operator/pkg/controller/testing" + testing2 "github.com/integr8ly/grafana-operator/v3/pkg/controller/testing" "testing" ) diff --git a/pkg/controller/grafanadashboard/dashboard_controller.go b/pkg/controller/grafanadashboard/dashboard_controller.go index efd35aa04..6cb66a421 100644 --- a/pkg/controller/grafanadashboard/dashboard_controller.go +++ b/pkg/controller/grafanadashboard/dashboard_controller.go @@ -4,9 +4,9 @@ import ( "context" defaultErrors "errors" "fmt" - i8ly "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/common" - "github.com/integr8ly/grafana-operator/pkg/controller/config" + grafanav1alpha1 "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/common" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" @@ -56,7 +56,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler, namespace string) error { } // Watch for changes to primary resource GrafanaDashboard - err = c.Watch(&source.Kind{Type: &i8ly.GrafanaDashboard{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(&source.Kind{Type: &grafanav1alpha1.GrafanaDashboard{}}, &handler.EnqueueRequestForObject{}) if err == nil { log.Info("Starting dashboard controller") } @@ -130,7 +130,7 @@ func (r *ReconcileGrafanaDashboard) Reconcile(request reconcile.Request) (reconc } // Fetch the GrafanaDashboard instance - instance := &i8ly.GrafanaDashboard{} + instance := &grafanav1alpha1.GrafanaDashboard{} err = r.client.Get(r.context, request.NamespacedName, instance) if err != nil { if errors.IsNotFound(err) { @@ -157,14 +157,14 @@ func (r *ReconcileGrafanaDashboard) Reconcile(request reconcile.Request) (reconc func (r *ReconcileGrafanaDashboard) reconcileDashboards(request reconcile.Request, grafanaClient GrafanaClient) (reconcile.Result, error) { // Collect known and namespace dashboards knownDashboards := r.config.GetDashboards(request.Namespace) - namespaceDashboards := &i8ly.GrafanaDashboardList{} + namespaceDashboards := &grafanav1alpha1.GrafanaDashboardList{} err := r.client.List(r.context, namespaceDashboards) if err != nil { return reconcile.Result{}, err } // Prepare lists - var dashboardsToDelete []*i8ly.GrafanaDashboardRef + var dashboardsToDelete []*grafanav1alpha1.GrafanaDashboardRef // Check if a given dashboard (by name) is present in the list of // dashboards in the namespace @@ -178,7 +178,7 @@ func (r *ReconcileGrafanaDashboard) reconcileDashboards(request reconcile.Reques } // Returns the hash of a dashboard if it is known - findHash := func(item *i8ly.GrafanaDashboard) string { + findHash := func(item *grafanav1alpha1.GrafanaDashboard) string { for _, d := range knownDashboards { if item.Name == d.Name { return d.Hash @@ -255,7 +255,7 @@ func (r *ReconcileGrafanaDashboard) reconcileDashboards(request reconcile.Reques // Handle success case: update dashboard metadata (id, uid) and update the list // of plugins -func (r *ReconcileGrafanaDashboard) manageSuccess(dashboard *i8ly.GrafanaDashboard, status GrafanaResponse, hash string) error { +func (r *ReconcileGrafanaDashboard) manageSuccess(dashboard *grafanav1alpha1.GrafanaDashboard, status GrafanaResponse, hash string) error { msg := fmt.Sprintf("dashboard %v/%v successfully submitted", dashboard.Namespace, dashboard.Name) @@ -266,7 +266,7 @@ func (r *ReconcileGrafanaDashboard) manageSuccess(dashboard *i8ly.GrafanaDashboa dashboard.Status.UID = *status.UID dashboard.Status.ID = *status.ID dashboard.Status.Slug = *status.Slug - dashboard.Status.Phase = i8ly.PhaseReconciling + dashboard.Status.Phase = grafanav1alpha1.PhaseReconciling dashboard.Status.Hash = hash dashboard.Status.Message = "success" @@ -277,9 +277,9 @@ func (r *ReconcileGrafanaDashboard) manageSuccess(dashboard *i8ly.GrafanaDashboa } // Handle error case: update dashboard with error message and status -func (r *ReconcileGrafanaDashboard) manageError(dashboard *i8ly.GrafanaDashboard, issue error) { +func (r *ReconcileGrafanaDashboard) manageError(dashboard *grafanav1alpha1.GrafanaDashboard, issue error) { r.recorder.Event(dashboard, "Warning", "ProcessingError", issue.Error()) - dashboard.Status.Phase = i8ly.PhaseFailing + dashboard.Status.Phase = grafanav1alpha1.PhaseFailing dashboard.Status.Message = issue.Error() err := r.client.Status().Update(r.context, dashboard) @@ -314,7 +314,7 @@ func (r *ReconcileGrafanaDashboard) getClient() (GrafanaClient, error) { } // Test if a given dashboard matches an array of label selectors -func (r *ReconcileGrafanaDashboard) isMatch(item *i8ly.GrafanaDashboard) bool { +func (r *ReconcileGrafanaDashboard) isMatch(item *grafanav1alpha1.GrafanaDashboard) bool { if r.state.DashboardSelectors == nil { return false } diff --git a/pkg/controller/grafanadashboard/dashboard_pipeline.go b/pkg/controller/grafanadashboard/dashboard_pipeline.go index 1744771e7..02d25b8aa 100644 --- a/pkg/controller/grafanadashboard/dashboard_pipeline.go +++ b/pkg/controller/grafanadashboard/dashboard_pipeline.go @@ -7,7 +7,7 @@ import ( "errors" "fmt" "github.com/go-logr/logr" - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" "io/ioutil" "net/http" "net/url" diff --git a/pkg/controller/grafanadatasource/datasource_controller.go b/pkg/controller/grafanadatasource/datasource_controller.go index 67d4bb109..38ed841cf 100644 --- a/pkg/controller/grafanadatasource/datasource_controller.go +++ b/pkg/controller/grafanadatasource/datasource_controller.go @@ -4,10 +4,10 @@ import ( "context" "crypto/md5" "fmt" - i8ly "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/common" - "github.com/integr8ly/grafana-operator/pkg/controller/config" - "github.com/integr8ly/grafana-operator/pkg/controller/model" + grafanav1alpha1 "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/common" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/model" "io" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -63,7 +63,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler, namespace string) error { } // Watch for changes to primary resource GrafanaDataSource - err = c.Watch(&source.Kind{Type: &i8ly.GrafanaDataSource{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(&source.Kind{Type: &grafanav1alpha1.GrafanaDataSource{}}, &handler.EnqueueRequestForObject{}) if err != nil { return err } @@ -140,7 +140,7 @@ func (r *ReconcileGrafanaDataSource) Reconcile(request reconcile.Request) (recon } func (r *ReconcileGrafanaDataSource) reconcileDataSources(state *common.DataSourcesState) error { - var dataSourcesToAddOrUpdate []i8ly.GrafanaDataSource + var dataSourcesToAddOrUpdate []grafanav1alpha1.GrafanaDataSource var dataSourcesToDelete []string // check if a given datasource (by its key) is found on the cluster @@ -177,7 +177,7 @@ func (r *ReconcileGrafanaDataSource) reconcileDataSources(state *common.DataSour } // apply dataSourcesToAddOrUpdate - updated := []i8ly.GrafanaDataSource{} + updated := []grafanav1alpha1.GrafanaDataSource{} for _, ds := range dataSourcesToAddOrUpdate { pipeline := NewDatasourcePipeline(&ds) err := pipeline.ProcessDatasource(state.KnownDataSources) @@ -244,7 +244,7 @@ func (i *ReconcileGrafanaDataSource) updateHash(known *v1.ConfigMap) (string, er } // Handle error case: update datasource with error message and status -func (r *ReconcileGrafanaDataSource) manageError(datasource *i8ly.GrafanaDataSource, issue error) { +func (r *ReconcileGrafanaDataSource) manageError(datasource *grafanav1alpha1.GrafanaDataSource, issue error) { r.recorder.Event(datasource, "Warning", "ProcessingError", issue.Error()) // datasource deleted @@ -252,7 +252,7 @@ func (r *ReconcileGrafanaDataSource) manageError(datasource *i8ly.GrafanaDataSou return } - datasource.Status.Phase = i8ly.PhaseFailing + datasource.Status.Phase = grafanav1alpha1.PhaseFailing datasource.Status.Message = issue.Error() err := r.client.Status().Update(r.context, datasource) @@ -267,13 +267,13 @@ func (r *ReconcileGrafanaDataSource) manageError(datasource *i8ly.GrafanaDataSou // manage success case: datasource has been imported successfully and the configmap // is updated -func (r *ReconcileGrafanaDataSource) manageSuccess(datasources []i8ly.GrafanaDataSource) { +func (r *ReconcileGrafanaDataSource) manageSuccess(datasources []grafanav1alpha1.GrafanaDataSource) { for _, datasource := range datasources { log.Info(fmt.Sprintf("datasource %v/%v successfully imported", datasource.Namespace, datasource.Name)) - datasource.Status.Phase = i8ly.PhaseReconciling + datasource.Status.Phase = grafanav1alpha1.PhaseReconciling datasource.Status.Message = "success" err := r.client.Status().Update(r.context, &datasource) diff --git a/pkg/controller/grafanadatasource/datasource_pipeline.go b/pkg/controller/grafanadatasource/datasource_pipeline.go index ccaeb74bb..fa5f90729 100644 --- a/pkg/controller/grafanadatasource/datasource_pipeline.go +++ b/pkg/controller/grafanadatasource/datasource_pipeline.go @@ -2,7 +2,7 @@ package grafanadatasource import ( "github.com/ghodss/yaml" - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" ) diff --git a/pkg/controller/model/adminUserSecret.go b/pkg/controller/model/adminUserSecret.go index 7fb4f13d8..48343dfd7 100644 --- a/pkg/controller/model/adminUserSecret.go +++ b/pkg/controller/model/adminUserSecret.go @@ -1,7 +1,7 @@ package model import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" v12 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/controller/model/grafanaConfig.go b/pkg/controller/model/grafanaConfig.go index 57d6114c7..c9db94592 100644 --- a/pkg/controller/model/grafanaConfig.go +++ b/pkg/controller/model/grafanaConfig.go @@ -1,8 +1,8 @@ package model import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/config" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" v1 "k8s.io/api/core/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/controller/model/grafanaDatasources.go b/pkg/controller/model/grafanaDatasources.go index 7689bd19a..9c4859842 100644 --- a/pkg/controller/model/grafanaDatasources.go +++ b/pkg/controller/model/grafanaDatasources.go @@ -1,7 +1,7 @@ package model import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" v1 "k8s.io/api/core/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/controller/model/grafanaDeployment.go b/pkg/controller/model/grafanaDeployment.go index 25879cc08..5f388aa31 100644 --- a/pkg/controller/model/grafanaDeployment.go +++ b/pkg/controller/model/grafanaDeployment.go @@ -2,8 +2,8 @@ package model import ( "fmt" - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" - "github.com/integr8ly/grafana-operator/pkg/controller/config" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/controller/config" v1 "k8s.io/api/apps/v1" v13 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" diff --git a/pkg/controller/model/grafanaIngress.go b/pkg/controller/model/grafanaIngress.go index 2a7d44ab8..6f89e9f7a 100644 --- a/pkg/controller/model/grafanaIngress.go +++ b/pkg/controller/model/grafanaIngress.go @@ -1,7 +1,7 @@ package model import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/controller/model/grafanaRoute.go b/pkg/controller/model/grafanaRoute.go index ac8877ef8..513421667 100644 --- a/pkg/controller/model/grafanaRoute.go +++ b/pkg/controller/model/grafanaRoute.go @@ -1,7 +1,7 @@ package model import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" v1 "github.com/openshift/api/route/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" diff --git a/pkg/controller/model/grafanaService.go b/pkg/controller/model/grafanaService.go index 24fa37fd3..1ebb08ad7 100644 --- a/pkg/controller/model/grafanaService.go +++ b/pkg/controller/model/grafanaService.go @@ -1,7 +1,7 @@ package model import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" v1 "k8s.io/api/core/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" diff --git a/pkg/controller/model/grafanaServiceAccount.go b/pkg/controller/model/grafanaServiceAccount.go index cd0369778..2848b703a 100644 --- a/pkg/controller/model/grafanaServiceAccount.go +++ b/pkg/controller/model/grafanaServiceAccount.go @@ -1,7 +1,7 @@ package model import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" v1 "k8s.io/api/core/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/controller/testing/testing_shared.go b/pkg/controller/testing/testing_shared.go index 543ec0b49..ba7c17afa 100644 --- a/pkg/controller/testing/testing_shared.go +++ b/pkg/controller/testing/testing_shared.go @@ -1,7 +1,7 @@ package testing import ( - "github.com/integr8ly/grafana-operator/pkg/apis/integreatly/v1alpha1" + "github.com/integr8ly/grafana-operator/v3/pkg/apis/integreatly/v1alpha1" v12 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" )