Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow "auto" setting for gauge min and max #234

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading