hashicorp/consul

Allow ${ } style interpolation for UI dashboard template URLs

Open

#11,321 创建于 2021年10月14日

在 GitHub 查看
 (4 评论) (0 反应) (1 负责人)Go (29,891 star) (4,588 fork)batch import
Hacktoberfestgood first issuetheme/operator-usabilitytheme/uitype/enhancement

描述

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.

贡献者指南