diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d799f70e5..90185bf728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ 1. [16249](https://github.com/influxdata/influxdb/pull/16249): Prevent potential infinite loop when finding tasks by organization. 1. [16255](https://github.com/influxdata/influxdb/pull/16255): Retain user input when parsing invalid JSON during import 1. [16268](https://github.com/influxdata/influxdb/pull/16268): Fixed test flakiness that stemmed from multiple flush/signins being called in the same test suite +1. [16346](https://github.com/influxdata/influxdb/pull/16346): Update pkger task export to only trim out option task and not all vars provided ### UI Improvements diff --git a/pkger/clone_resource.go b/pkger/clone_resource.go index 5b242c38d5..90d33e665e 100644 --- a/pkger/clone_resource.go +++ b/pkger/clone_resource.go @@ -502,18 +502,14 @@ func ruleToResource(iRule influxdb.NotificationRule, endpointName, name string) } // regex used to rip out the hard coded task option stuffs -var taskFluxRegex = regexp.MustCompile(`option task = {(.|\n)*}`) +var taskFluxRegex = regexp.MustCompile(`option task = {(.|\n)*?}`) func taskToResource(t influxdb.Task, name string) Resource { if name == "" { name = t.Name } - var query = t.Flux - groups := taskFluxRegex.Split(t.Flux, 2) - if len(groups) > 1 { - query = strings.TrimSpace(groups[1]) - } + query := strings.TrimSpace(taskFluxRegex.ReplaceAllString(t.Flux, "")) r := Resource{ fieldKind: KindTask.title(),