diff --git a/.go-version b/.go-version index 069b921..24647e5 100644 --- a/.go-version +++ b/.go-version @@ -1,2 +1 @@ -1.95.1 - +1.95.2 diff --git a/lightstep/resource_dashboard_test.go b/lightstep/resource_dashboard_test.go index fef9939..5d4287c 100644 --- a/lightstep/resource_dashboard_test.go +++ b/lightstep/resource_dashboard_test.go @@ -1482,7 +1482,7 @@ EOT }) } -func TestAccDashboardHiddenQueriesUnresolvableDiff(t *testing.T) { +func TestAccDashboardHiddenQueriesWithOuterQueryHidden(t *testing.T) { config := ` resource "lightstep_dashboard" "test" { project_name = "` + testProject + `" @@ -1514,10 +1514,11 @@ resource "lightstep_dashboard" "test" { Config: config, Check: resource.ComposeTestCheckFunc( testAccCheckMetricDashboardExists(resourceName, &dashboard), + resource.TestCheckResourceAttr(resourceName, "chart.#", "1"), + resource.TestCheckResourceAttr(resourceName, "chart.0.query.#", "1"), + resource.TestCheckResourceAttr(resourceName, "chart.0.query.0.hidden", "false"), + resource.TestCheckResourceAttr(resourceName, "chart.0.query.0.hidden_queries.a", "true"), ), - // 🐛 this plan should be empty, but we omit hidden_queries["a"] from state - // because it is the top level query name (also we overwrite the value using "hidden") - ExpectNonEmptyPlan: true, }, }, }) diff --git a/lightstep/resource_metric_condition.go b/lightstep/resource_metric_condition.go index 21c6de5..df3154a 100644 --- a/lightstep/resource_metric_condition.go +++ b/lightstep/resource_metric_condition.go @@ -836,9 +836,6 @@ func buildQueries(queriesIn []interface{}) ([]client.MetricQueryWithAttributes, hq[k] = false } } - // Ensure the outer query is always included for the API call. - // Don't make the user do this explicitly. - hq[newQuery.Name] = newQuery.Hidden newQuery.HiddenQueries = hq } diff --git a/lightstep/util.go b/lightstep/util.go index 0a07aad..fbcd359 100644 --- a/lightstep/util.go +++ b/lightstep/util.go @@ -35,10 +35,6 @@ func setHiddenQueriesFromResourceData(qs map[string]interface{}, query client.Me } hq := make(map[string]interface{}, len(query.HiddenQueries)) for k, v := range query.HiddenQueries { - // Don't include the top-level query in the TF resource data - if k == query.Name { - continue - } hq[k] = fmt.Sprintf("%t", v) } qs["hidden_queries"] = hq