From cebdbde5a870c6b232947cc578d51ec88ef60df5 Mon Sep 17 00:00:00 2001 From: srinandan <13950006+srinandan@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:06:07 -0700 Subject: [PATCH] feat: ignore config vars from overrides #218 --- internal/client/integrations/overrides.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/internal/client/integrations/overrides.go b/internal/client/integrations/overrides.go index 6889132..f29ae0e 100644 --- a/internal/client/integrations/overrides.go +++ b/internal/client/integrations/overrides.go @@ -355,7 +355,15 @@ func handleGenericRestV2Task(taskConfig taskconfig, taskOverrides *overrides) er tc.TaskId = taskConfig.TaskId tc.Task = taskConfig.Task tc.Parameters = map[string]eventparameter{} - tc.Parameters["url"] = taskConfig.Parameters["url"] + + // store in overrides only if config variables are not used + urlEventParam := taskConfig.Parameters["url"] + if urlEventParam.Value.StringValue != nil && !strings.HasPrefix(*urlEventParam.Value.StringValue, "$`CONFIG_") { + tc.Parameters["url"] = taskConfig.Parameters["url"] + } else if urlEventParam.Value.IntValue != nil && !strings.HasPrefix(*urlEventParam.Value.IntValue, "$`CONFIG_") { + tc.Parameters["url"] = taskConfig.Parameters["url"] + } + if _, ok := taskConfig.Parameters["authConfig"]; ok { displayName, err := authconfigs.GetDisplayName(getAuthConfigUuid(*taskConfig.Parameters["authConfig"].Value.JsonValue)) if err != nil { @@ -370,7 +378,10 @@ func handleGenericRestV2Task(taskConfig taskconfig, taskOverrides *overrides) er } } - taskOverrides.TaskOverrides = append(taskOverrides.TaskOverrides, tc) + + if len(tc.Parameters) > 0 { + taskOverrides.TaskOverrides = append(taskOverrides.TaskOverrides, tc) + } return nil }