Skip to content

Commit

Permalink
skip the lbac rules for example tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eleijonmarck committed Nov 27, 2024
1 parent a8a423b commit 0869822
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/resources/data_source_config_lbac_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ]
# }

Original file line number Diff line number Diff line change
Expand Up @@ -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\" }",
}

Expand Down Expand Up @@ -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"
}
Expand All @@ -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
]
}
Expand Down

0 comments on commit 0869822

Please sign in to comment.