Skip to content

Commit

Permalink
Slightly rewrite the switch
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Beliakov <demtis.register@gmail.com>
  • Loading branch information
weisdd committed Jul 20, 2022
1 parent 8382061 commit 3dd7eb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/grafana/grafana_controller.go
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 3dd7eb6

Please sign in to comment.