From 086982285ffdf1cdda5b14e52233175f69861341 Mon Sep 17 00:00:00 2001 From: Eric Leijonmarck Date: Wed, 27 Nov 2024 14:34:26 +0000 Subject: [PATCH] skip the lbac rules for example tests --- .../data_source_config_lbac_rules.md | 2 +- .../resource.tf | 27 ++++++++++--------- ...urce_data_source_config_lbac_rules_test.go | 18 ++++++------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/docs/resources/data_source_config_lbac_rules.md b/docs/resources/data_source_config_lbac_rules.md index acbbd62ed..e095f1f61 100644 --- a/docs/resources/data_source_config_lbac_rules.md +++ b/docs/resources/data_source_config_lbac_rules.md @@ -50,7 +50,7 @@ resource "grafana_data_source_config_lbac_rules" "test_rule" { }) depends_on = [ - grafana_team.test, + grafana_team.team, grafana_data_source.test ] } diff --git a/examples/resources/grafana_data_source_config_lbac_rules/resource.tf b/examples/resources/grafana_data_source_config_lbac_rules/resource.tf index 5b20e0a62..8ba049b35 100644 --- a/examples/resources/grafana_data_source_config_lbac_rules/resource.tf +++ b/examples/resources/grafana_data_source_config_lbac_rules/resource.tf @@ -15,18 +15,19 @@ resource "grafana_data_source" "test" { }) } -resource "grafana_data_source_config_lbac_rules" "test_rule" { - datasource_uid = grafana_data_source.test.uid - rules = jsonencode({ - "${grafana_team.team.team_uid}" = [ - "{ cluster = \"dev-us-central-0\", namespace = \"hosted-grafana\" }", - "{ foo = \"qux\" }" - ] - }) +# TODO: add back 5th of dec +# resource "grafana_data_source_config_lbac_rules" "test_rule" { +# datasource_uid = grafana_data_source.test.uid +# rules = jsonencode({ +# "${grafana_team.team.team_uid}" = [ +# "{ cluster = \"dev-us-central-0\", namespace = \"hosted-grafana\" }", +# "{ foo = \"qux\" }" +# ] +# }) - depends_on = [ - grafana_team.team, - grafana_data_source.test - ] -} +# depends_on = [ +# grafana_team.team, +# grafana_data_source.test +# ] +# } diff --git a/internal/resources/grafana/resource_data_source_config_lbac_rules_test.go b/internal/resources/grafana/resource_data_source_config_lbac_rules_test.go index 488c80372..ac7cf41c2 100644 --- a/internal/resources/grafana/resource_data_source_config_lbac_rules_test.go +++ b/internal/resources/grafana/resource_data_source_config_lbac_rules_test.go @@ -31,7 +31,7 @@ func TestAccDataSourceConfigLBACRules_basic(t *testing.T) { } expectedRules := []string{ - "{ foo != \"bar\", foo !~ \"baz\" }", + "{ cluster = \"dev-us-central-0\", namespace = \"hosted-grafana\" }", "{ foo = \"qux\" }", } @@ -68,7 +68,7 @@ func TestAccDataSourceConfigLBACRules_basic(t *testing.T) { func testAccDataSourceConfigLBACRules(name string) string { return fmt.Sprintf(` -resource "grafana_team" "test" { +resource "grafana_team" "team" { name = "%[1]s-team" } @@ -86,15 +86,15 @@ resource "grafana_data_source" "test" { resource "grafana_data_source_config_lbac_rules" "test" { datasource_uid = grafana_data_source.test.uid - rules = jsonencode({ - "${grafana_team.test.team_uid}" = [ - "{ foo != \"bar\", foo !~ \"baz\" }", - "{ foo = \"qux\" }" - ] - }) + rules = jsonencode({ + "${grafana_team.team.team_uid}" = [ + "{ cluster = \"dev-us-central-0\", namespace = \"hosted-grafana\" }", + "{ foo = \"qux\" }" + ] + }) depends_on = [ - grafana_team.test, + grafana_team.team, grafana_data_source.test ] }