Skip to content

Commit

Permalink
feat(pkger): add parser support for notification rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteenb2 committed Dec 19, 2019
1 parent 5b859a2 commit 1d3e0da
Show file tree
Hide file tree
Showing 7 changed files with 669 additions and 35 deletions.
13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

### Features

1. [16234](https://github.com/influxdata/influxdb/pull/16234): add support for notification endpoints to influx templates/pkgs.
2. [16242](https://github.com/influxdata/influxdb/pull/16242): drop id prefix for secret key requirement for notification endpoints
3. [16259](https://github.com/influxdata/influxdb/pull/16259): add support for check resource to pkger parser
4. [16262](https://github.com/influxdata/influxdb/pull/16262): add support for check resource dry run functionality
5. [16275](https://github.com/influxdata/influxdb/pull/16275): add support for check resource apply functionality
6. [16283](https://github.com/influxdata/influxdb/pull/16283): add support for check resource export functionality
1. [16234](https://github.com/influxdata/influxdb/pull/16234): Add support for notification endpoints to influx templates/pkgs.
2. [16242](https://github.com/influxdata/influxdb/pull/16242): Drop id prefix for secret key requirement for notification endpoints
3. [16259](https://github.com/influxdata/influxdb/pull/16259): Add support for check resource to pkger parser
4. [16262](https://github.com/influxdata/influxdb/pull/16262): Add support for check resource dry run functionality
5. [16275](https://github.com/influxdata/influxdb/pull/16275): Add support for check resource apply functionality
6. [16283](https://github.com/influxdata/influxdb/pull/16283): Add support for check resource export functionality
1. [16212](https://github.com/influxdata/influxdb/pull/16212): Add new kv.ForwardCursor interface
1. [16297](https://github.com/influxdata/influxdb/pull/16297): Add support for notification rule to pkger parser

### Bug Fixes

Expand Down
8 changes: 4 additions & 4 deletions pkger/clone_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func checkToResource(ch influxdb.Check, name string) Resource {
assignBase := func(base icheck.Base) {
r[fieldQuery] = base.Query.Text
r[fieldCheckStatusMessageTemplate] = base.StatusMessageTemplate
assignFluxDur(fieldCheckEvery, base.Every)
assignFluxDur(fieldCheckOffset, base.Offset)
assignFluxDur(fieldEvery, base.Every)
assignFluxDur(fieldOffset, base.Offset)
var tags []Resource
for _, t := range base.Tags {
if t.Valid() != nil {
Expand All @@ -112,7 +112,7 @@ func checkToResource(ch influxdb.Check, name string) Resource {
assignBase(cT.Base)
assignFluxDur(fieldCheckTimeSince, cT.TimeSince)
assignFluxDur(fieldCheckStaleTime, cT.StaleTime)
r[fieldCheckLevel] = cT.Level.String()
r[fieldLevel] = cT.Level.String()
assignNonZeroBools(r, map[string]bool{fieldCheckReportZero: cT.ReportZero})
case *icheck.Threshold:
r[fieldKind] = KindCheckThreshold.title()
Expand All @@ -127,7 +127,7 @@ func checkToResource(ch influxdb.Check, name string) Resource {
}

func convertThreshold(th icheck.ThresholdConfig) Resource {
r := Resource{fieldCheckLevel: th.GetLevel().String()}
r := Resource{fieldLevel: th.GetLevel().String()}

switch realType := th.(type) {
case icheck.Lesser:
Expand Down
Loading

0 comments on commit 1d3e0da

Please sign in to comment.