-
Notifications
You must be signed in to change notification settings - Fork 336
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
GUI server config #428
GUI server config #428
Conversation
pkg/gui/gui_config.go
Outdated
func FromServerConfig(config gui_server.GuiConfig) GuiConfig { | ||
return GuiConfig{ | ||
ApiUrl: config.ApiUrl, | ||
Environment: config.Environment, |
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.
Similarly to the earlier comment, why do we configure Environment
separately leaving a room for a contradiction between ApiUrl
and Environment
?
pkg/gui/gui_config.go
Outdated
Environment string `json:"environment"` | ||
} | ||
|
||
func FromServerConfig(config gui_server.GuiConfig) GuiConfig { |
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.
Let's keep FromServerConfig()
func in a package other than types/
(e.g., in server/
rather than server/types/
)
Motivation: to make it clear that REST API doesn't depend on config types
0715baf
to
494a565
Compare
cbd92eb
to
97154b8
Compare
writer.WriteHeader(500) | ||
return | ||
} | ||
if _, err := writer.Write(bytes); err != nil { |
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.
Let's set Content-Type: application/json
Summary
The problem is that even if we expose the GUI on some port, the API is on a different one. We need to deliver configuration about API coordinates. To do this, we can expose
/config
endpoint with configuration.I used similar pattern to Catalog for now, which is keep it as Kuma Config, but don't expose env vars/yaml. Autoconfig everything.
Once we get more options for frontend, we can put it in the
GuiConfig
and use standard way to configure Kuma CP to configure embedded frontend.Also I exposed the environment variable, to display if kuma is running on k8s or not on the GUI.