fix: return correct message about unsupported protocol #796
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There's a cosmetic bug in
getGrafanaAdminUrl
- if unsupported protocol is chosen throughconfig.server.protocol
, the operator would always complain abouthttp
instead of actual protocol:server protocol http is not supported, please use either http or https
.The PR fixes that.
Type of change
Checklist
Verification steps
Deploy grafana with the following config:
You should see a reference to
unknown-protocol
in the error message:grafana-operator-846d554b57-vvxgs grafana-operator 2022-07-20T16:28:21.238Z DEBUG controller-runtime.manager.events Warning {"object": {"kind":"Grafana","namespace":"monitoring","name":"example-grafana","uid":"f218c504-fd0a-4fc2-8e6f-5519f369c97c","apiVersion":"integreatly.org/v1alpha1","resourceVersion":"503482"}, "reason": "ProcessingError", "message": "server protocol unknown-protocol is not supported, please use either http or https"}