From ea9fdaca78250e9bed937af9aa816b782ff457f5 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Mon, 29 Jan 2024 09:11:08 -0800 Subject: [PATCH] Add unit test to demo the use of duplicated dynamic log links Signed-off-by: Eduardo Apolinario --- .../go/tasks/logs/logging_utils_test.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/flyteplugins/go/tasks/logs/logging_utils_test.go b/flyteplugins/go/tasks/logs/logging_utils_test.go index 46f4f1cbe8..887009e95e 100644 --- a/flyteplugins/go/tasks/logs/logging_utils_test.go +++ b/flyteplugins/go/tasks/logs/logging_utils_test.go @@ -388,6 +388,27 @@ func TestGetLogsForContainerInPod_Flyteinteractive(t *testing.T) { }, nil, }, + { + "Flyteinteractive - multiple uses of the template (invalid use of ports in a URI)", + &LogConfig{ + DynamicLogLinks: map[string]tasklog.TemplateURI{ + "vscode": "https://abc.com:{{ .taskConfig.port }}:{{ .taskConfig.port}}", + }, + }, + &core.TaskTemplate{ + Config: map[string]string{ + "link_type": "vscode", + "port": "65535", + }, + }, + []*core.TaskLog{ + { + Uri: "https://abc.com:65535:65535", + MessageFormat: core.TaskLog_JSON, + Name: "vscode logs my-Suffix", + }, + }, + }, { "Flyteinteractive disabled and K8s enabled and flyteinteractive config present in TaskTemplate", &LogConfig{