From 3b55c2fc0193b32ce944b6fc0f6c8f4553875a49 Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Tue, 20 Oct 2020 12:50:29 -0500 Subject: [PATCH] client: add tests around meta and canarymeta interpolation Expanding on #9096, add tests for making sure service.Meta and service.CanaryMeta are interpolated from environment variables. --- client/taskenv/services_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client/taskenv/services_test.go b/client/taskenv/services_test.go index 88577d6de3..e50d612376 100644 --- a/client/taskenv/services_test.go +++ b/client/taskenv/services_test.go @@ -16,6 +16,12 @@ func TestInterpolateServices(t *testing.T) { Name: "${name}", PortLabel: "${portlabel}", Tags: []string{"${tags}"}, + Meta: map[string]string{ + "meta-key": "${meta}", + }, + CanaryMeta: map[string]string{ + "canarymeta-key": "${canarymeta}", + }, Checks: []*structs.ServiceCheck{ { Name: "${checkname}", @@ -40,6 +46,8 @@ func TestInterpolateServices(t *testing.T) { "name": "name", "portlabel": "portlabel", "tags": "tags", + "meta": "meta-value", + "canarymeta": "canarymeta-value", "checkname": "checkname", "checktype": "checktype", "checkcmd": "checkcmd", @@ -62,6 +70,12 @@ func TestInterpolateServices(t *testing.T) { Name: "name", PortLabel: "portlabel", Tags: []string{"tags"}, + Meta: map[string]string{ + "meta-key": "meta-value", + }, + CanaryMeta: map[string]string{ + "canarymeta-key": "canarymeta-value", + }, Checks: []*structs.ServiceCheck{ { Name: "checkname",