From f459f5e00c4673ee170f56456e022e77f921fce1 Mon Sep 17 00:00:00 2001 From: Jorge Marey Date: Thu, 15 Oct 2020 08:08:06 +0200 Subject: [PATCH] Add interpolation on service canarymeta --- client/taskenv/services.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/taskenv/services.go b/client/taskenv/services.go index 74bf673b18d..5c9029c4ada 100644 --- a/client/taskenv/services.go +++ b/client/taskenv/services.go @@ -57,6 +57,14 @@ func InterpolateServices(taskEnv *TaskEnv, services []*structs.Service) []*struc service.Meta = meta } + if len(service.CanaryMeta) > 0 { + canaryMeta := make(map[string]string, len(service.CanaryMeta)) + for k, v := range service.CanaryMeta { + canaryMeta[k] = taskEnv.ReplaceEnv(v) + } + service.CanaryMeta = canaryMeta + } + interpolated[i] = service }