Skip to content

Commit

Permalink
Merge pull request #219 from GoogleCloudPlatform/issue218
Browse files Browse the repository at this point in the history
feat: ignore config vars from overrides #218
  • Loading branch information
ssvaidyanathan authored Mar 12, 2024
2 parents b257215 + cebdbde commit 82de085
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions internal/client/integrations/overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

Expand Down

0 comments on commit 82de085

Please sign in to comment.