Skip to content

Commit

Permalink
allow "auto" setting for gauge min and max (#234)
Browse files Browse the repository at this point in the history
* auto

* added terraform docs

---------

Co-authored-by: MisterSquishy <MisterSquishy@users.noreply.github.com>
  • Loading branch information
MisterSquishy and MisterSquishy authored Sep 4, 2024
1 parent bda7025 commit b43341a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.98.0
1.98.1
8 changes: 4 additions & 4 deletions docs/resources/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ Optional:
- `comparison_window_ms` (Number)
- `display_type` (String)
- `is_donut` (Boolean)
- `max` (Number)
- `min` (Number)
- `max` (String)
- `min` (String)
- `sort_by` (String)
- `sort_direction` (String)
- `y_axis_log_base` (Number)
Expand Down Expand Up @@ -280,8 +280,8 @@ Optional:
- `comparison_window_ms` (Number)
- `display_type` (String)
- `is_donut` (Boolean)
- `max` (Number)
- `min` (Number)
- `max` (String)
- `min` (String)
- `sort_by` (String)
- `sort_direction` (String)
- `y_axis_log_base` (Number)
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ Optional:
- `comparison_window_ms` (Number)
- `display_type` (String)
- `is_donut` (Boolean)
- `max` (Number)
- `min` (Number)
- `max` (String)
- `min` (String)
- `sort_by` (String)
- `sort_direction` (String)
- `y_axis_log_base` (Number)
Expand Down Expand Up @@ -316,8 +316,8 @@ Optional:
- `comparison_window_ms` (Number)
- `display_type` (String)
- `is_donut` (Boolean)
- `max` (Number)
- `min` (Number)
- `max` (String)
- `min` (String)
- `sort_by` (String)
- `sort_direction` (String)
- `y_axis_log_base` (Number)
Expand Down
11 changes: 7 additions & 4 deletions lightstep/resource_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package lightstep

import (
"fmt"
"regexp"

"github.com/lightstep/terraform-provider-lightstep/client"

Expand Down Expand Up @@ -118,12 +119,14 @@ func getUnifiedQuerySchemaMap() map[string]*schema.Schema {
Optional: true,
},
"min": {
Type: schema.TypeInt,
Optional: true,
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^(\d|\.)*$`), ""),
},
"max": {
Type: schema.TypeInt,
Optional: true,
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^(\d|\.)*$`), ""),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions lightstep/resource_dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ group {
query_string = "metric cpu.utilization | delta | group_by[], sum"
display_type_options {
min = 0
max = 100
max = ""
}
}
}
Expand All @@ -1551,7 +1551,7 @@ group {
resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.#", "1"),
resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display", "gauge"),
resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display_type_options.0.min", "0"),
resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display_type_options.0.max", "100"),
resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display_type_options.0.max", ""),
),
},
},
Expand Down

0 comments on commit b43341a

Please sign in to comment.