hashicorp/consul

Allow ${ } style interpolation for UI dashboard template URLs

Open

#11.321 aperta il 14 ott 2021

Vedi su GitHub
 (4 commenti) (0 reazioni) (1 assegnatario)Go (4588 fork)batch import
Hacktoberfestgood first issuetheme/operator-usabilitytheme/uitype/enhancement

Metriche repository

Star
 (29.891 star)
Metriche merge PR
 (Merge medio 5g 8h) (73 PR mergiate in 30 g)

Descrizione

Feature Description

The ui_config.dashboard_url_templates config option supports specifying URL templates that can be used to render links to external dashboards in various contexts in the UI.

The field currently supports {{ }} interpolation for placeholders such as Service.Name and Datacenter.

Unfortunately, when specifying this configuration from within a Helm chart, Helm's own {{ }} interpolation conflicts with the interpolation for this field. The only way around that conflict is to escape the interpolation characters (so they are skipped by Helm, but caught by the Consul UI). This is confusing and error-prone.

To solve that, we want to add a second interpolation format: ${ }, so that the results of the following would be equivalent:

some-url-{{ Datacenter }} => some-url-dc1
some-url-${ Datacenter }  => some-url-dc1

This task includes:

For context, the render-template helper is used in the two places below, but that shouldn't matter assuming test cases are added to render-template-test.js:

Use Case(s)

Specifying ui_config.dashboard_url_templates from a Helm chart without needing to escape characters.

Guida contributor