-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
NET-5398: Update UI server to include if v2 is enabled #20353
Conversation
c9330f7
to
85aac2b
Compare
85aac2b
to
05cd0a2
Compare
This PR has diffs in |
05cd0a2
to
ddb730c
Compare
@@ -31,6 +31,14 @@ func uiTemplateDataFromConfig(cfg *config.RuntimeConfig) (map[string]interface{} | |||
uiCfg["metrics_provider_options"] = json.RawMessage(cfg.UIConfig.MetricsProviderOptionsJSON) | |||
} | |||
|
|||
v2CatalogEnabled := false | |||
for _, experiment := range cfg.Experiments { | |||
if experiment == "resource-apis" { |
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.
v1/agent/self
is an interesting endpoint 🤔 and the DebugConfig
field seems to be completely undocumented on the consul apis page.
Does "enabled" here mean the DC has a V2 service registered or just that it has the permission to register one?
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.
My understanding is it's like a feature flag, not telling you that you actually have services registered. However, if you have this experiment enabled, requests to V1 catalog endpoints don't succeed.
32a25b8
to
2b8feba
Compare
Description
For NET-5398 we need to not render the rest of the ui app if v2 catalog is enabled and show a message as to why it's disabled and link out to help resources. Right now this would require another network request on app boot and we would have to wait until that resolves before rendering the rest of the app.
I saw that experiments is a part of the runtime config so I figured we could add a
V2CatalogEnabled
property to the config that we pass to the UI app. With this, we can immediately check if V2 is enabled and render the help page, or immediately proceed with normal app operations if it's not enabled.Enabled:
Disabled:
Testing & Reproduction steps
I've tested this by building the ui and the consul and then running it with and without the resources-api experiment enabled. Reference the linked issues below for more instructions.
Links
NET-5398
Running Consul with v2 enabled
Original slack question about how to determine v2 is enabled
PR Checklist