diff --git a/controllers/grafana/grafana_controller.go b/controllers/grafana/grafana_controller.go index 9917e57eb..08cb6d2d4 100644 --- a/controllers/grafana/grafana_controller.go +++ b/controllers/grafana/grafana_controller.go @@ -275,13 +275,13 @@ func (r *ReconcileGrafana) getGrafanaAdminUrl(cr *grafanav1alpha1.Grafana, state protocol := "http" if cr.Spec.Config.Server != nil { - switch protocol = cr.Spec.Config.Server.Protocol; protocol { + switch cr.Spec.Config.Server.Protocol { case "", "http": protocol = "http" case "https": protocol = "https" default: - return "", fmt.Errorf("server protocol %v is not supported, please use either http or https", protocol) + return "", fmt.Errorf("server protocol %v is not supported, please use either http or https", cr.Spec.Config.Server.Protocol) } }