New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1777486: Read monitoriong URLs from the console-config configmap #4309
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,10 @@ type jsGlobals struct { | |
CustomLogoURL string `json:"customLogoURL"` | ||
StatuspageID string `json:"statuspageID"` | ||
DocumentationBaseURL string `json:"documentationBaseURL"` | ||
AlertManagerPublicURL string `json:"alertManagerPublicURL"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Alertmanager" is written as one word, so we should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was following the pattern we already use https://github.com/openshift/console/blob/master/pkg/server/server.go#L60 |
||
GrafanaPublicURL string `json:"grafanaPublicURL"` | ||
PrometheusPublicURL string `json:"prometheusPublicURL"` | ||
ThanosPublicURL string `json:"thanosPublicURL"` | ||
LoadTestFactor int `json:"loadTestFactor"` | ||
GOARCH string `json:"GOARCH"` | ||
GOOS string `json:"GOOS"` | ||
|
@@ -98,6 +102,11 @@ type Server struct { | |
HelmChartRepoProxyConfig *proxy.Config | ||
GOARCH string | ||
GOOS string | ||
// Monitoring and Logging related URLs | ||
AlertManagerPublicURL *url.URL | ||
GrafanaPublicURL *url.URL | ||
PrometheusPublicURL *url.URL | ||
ThanosPublicURL *url.URL | ||
} | ||
|
||
func (s *Server) authDisabled() bool { | ||
|
@@ -340,23 +349,27 @@ func (s *Server) handleMonitoringDashboardConfigmaps(w http.ResponseWriter, r *h | |
|
||
func (s *Server) indexHandler(w http.ResponseWriter, r *http.Request) { | ||
jsg := &jsGlobals{ | ||
ConsoleVersion: version.Version, | ||
AuthDisabled: s.authDisabled(), | ||
KubectlClientID: s.KubectlClientID, | ||
BasePath: s.BaseURL.Path, | ||
LoginURL: proxy.SingleJoiningSlash(s.BaseURL.String(), authLoginEndpoint), | ||
LoginSuccessURL: proxy.SingleJoiningSlash(s.BaseURL.String(), AuthLoginSuccessEndpoint), | ||
LoginErrorURL: proxy.SingleJoiningSlash(s.BaseURL.String(), AuthLoginErrorEndpoint), | ||
LogoutURL: proxy.SingleJoiningSlash(s.BaseURL.String(), authLogoutEndpoint), | ||
LogoutRedirect: s.LogoutRedirect.String(), | ||
KubeAPIServerURL: s.KubeAPIServerURL, | ||
Branding: s.Branding, | ||
CustomProductName: s.CustomProductName, | ||
StatuspageID: s.StatuspageID, | ||
DocumentationBaseURL: s.DocumentationBaseURL.String(), | ||
LoadTestFactor: s.LoadTestFactor, | ||
GOARCH: s.GOARCH, | ||
GOOS: s.GOOS, | ||
ConsoleVersion: version.Version, | ||
AuthDisabled: s.authDisabled(), | ||
KubectlClientID: s.KubectlClientID, | ||
BasePath: s.BaseURL.Path, | ||
LoginURL: proxy.SingleJoiningSlash(s.BaseURL.String(), authLoginEndpoint), | ||
LoginSuccessURL: proxy.SingleJoiningSlash(s.BaseURL.String(), AuthLoginSuccessEndpoint), | ||
LoginErrorURL: proxy.SingleJoiningSlash(s.BaseURL.String(), AuthLoginErrorEndpoint), | ||
LogoutURL: proxy.SingleJoiningSlash(s.BaseURL.String(), authLogoutEndpoint), | ||
LogoutRedirect: s.LogoutRedirect.String(), | ||
KubeAPIServerURL: s.KubeAPIServerURL, | ||
Branding: s.Branding, | ||
CustomProductName: s.CustomProductName, | ||
StatuspageID: s.StatuspageID, | ||
DocumentationBaseURL: s.DocumentationBaseURL.String(), | ||
AlertManagerPublicURL: s.AlertManagerPublicURL.String(), | ||
GrafanaPublicURL: s.GrafanaPublicURL.String(), | ||
PrometheusPublicURL: s.PrometheusPublicURL.String(), | ||
ThanosPublicURL: s.ThanosPublicURL.String(), | ||
GOARCH: s.GOARCH, | ||
GOOS: s.GOOS, | ||
LoadTestFactor: s.LoadTestFactor, | ||
} | ||
|
||
if !s.authDisabled() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
Alertmanager
instead ofAlertManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this one should be changed since it's public facing.