diff --git a/cmd/manager/main.go b/cmd/manager/main.go index b76f7cc1d..c14cf248c 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -26,6 +26,7 @@ import ( var log = logf.Log.WithName("cmd") var flagImage string var flagImageTag string +var flagPluginsInitContainerImage string var scanAll bool var openshift bool @@ -39,6 +40,7 @@ func init() { flagset := flag.CommandLine flagset.StringVar(&flagImage, "grafana-image", "", "Overrides the default Grafana image") flagset.StringVar(&flagImageTag, "grafana-image-tag", "", "Overrides the default Grafana image tag") + flagset.StringVar(&flagPluginsInitContainerImage, "grafana-plugins-init-container-image", "", "Overrides the default Grafana Plugins Init Container image") flagset.BoolVar(&scanAll, "scan-all", false, "Scans all namespaces for dashboards") flagset.BoolVar(&openshift, "openshift", false, "Use Route instead of Ingress") flagset.Parse(os.Args[1:]) @@ -89,6 +91,7 @@ func main() { controllerConfig := common.GetControllerConfig() controllerConfig.AddConfigItem(common.ConfigGrafanaImage, flagImage) controllerConfig.AddConfigItem(common.ConfigGrafanaImageTag, flagImageTag) + controllerConfig.AddConfigItem(common.PluginsInitContainerImage, flagPluginsInitContainerImage) controllerConfig.AddConfigItem(common.ConfigOperatorNamespace, namespace) controllerConfig.AddConfigItem(common.ConfigDashboardLabelSelector, "") controllerConfig.AddConfigItem(common.ConfigOpenshift, openshift) diff --git a/pkg/controller/common/controller_config.go b/pkg/controller/common/controller_config.go index 11fae9a0b..70980516f 100644 --- a/pkg/controller/common/controller_config.go +++ b/pkg/controller/common/controller_config.go @@ -26,6 +26,7 @@ const ( GrafanaRouteName = "grafana-route" GrafanaIngressName = "grafana-ingress" GrafanaServiceName = "grafana-service" + PluginsInitContainerImage = "quay.io/integreatly/grafana_plugins_init" PluginsInitContainerImageTag = "0.0.2" PluginsEnvVar = "GRAFANA_PLUGINS" PluginsUrl = "https://grafana.com/api/plugins/%s/versions/%s" diff --git a/pkg/controller/grafana/templateHelper.go b/pkg/controller/grafana/templateHelper.go index b42903c19..cb217d4da 100644 --- a/pkg/controller/grafana/templateHelper.go +++ b/pkg/controller/grafana/templateHelper.go @@ -29,6 +29,7 @@ type GrafanaParamaeters struct { LogLevel string GrafanaRouteName string GrafanaServiceName string + PluginsInitContainerImage string PluginsInitContainerImageTag string GrafanaIngressName string Hostname string @@ -91,6 +92,7 @@ func newTemplateHelper(cr *integreatly.Grafana) *TemplateHelper { LogLevel: getLogLevel(cr.Spec.LogLevel), GrafanaRouteName: common.GrafanaRouteName, GrafanaServiceName: common.GrafanaServiceName, + PluginsInitContainerImage: common.PluginsInitContainerImage, PluginsInitContainerImageTag: common.PluginsInitContainerImageTag, GrafanaIngressName: common.GrafanaIngressName, Hostname: cr.Spec.Hostname, diff --git a/templates/grafana-deployment.yaml b/templates/grafana-deployment.yaml index 5932b3694..bff516146 100644 --- a/templates/grafana-deployment.yaml +++ b/templates/grafana-deployment.yaml @@ -27,7 +27,7 @@ spec: - env: - name: GRAFANA_PLUGINS value: "" - image: 'quay.io/integreatly/grafana_plugins_init:{{ .PluginsInitContainerImageTag }}' + image: '{{ .PluginsInitContainerImage }}:{{ .PluginsInitContainerImageTag }}' imagePullPolicy: IfNotPresent name: grafana-plugins-init resources: {}