Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Oct 27, 2024
1 parent 677eef5 commit 9313ca9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion policies/yaml_schema.rego
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ deny[yaml_schema_violation(description, group.id, name)] {
group.type == "resource"
name := group.name

# TODO: remove once TODO is fixed
# TODO: remove once https://github.com/open-telemetry/semantic-conventions/pull/1423 is merged
exclusions := {"telemetry.sdk_experimental", "service_experimental"}
exclusions[name] != null

Expand Down
11 changes: 11 additions & 0 deletions policies/yaml_schema_test.rego
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ test_fails_on_invalid_span_id if {
}
}

test_fails_on_invalid_resource_id if {
invalid_ids := [
"foo.bar",
"resource..foo.bar",
"resource.foo.bar.deprecated",
]
every id in invalid_ids {
count(deny) >= 1 with input as {"groups": [{"id": id, "type": "resource", "name": "foo.bar"}]}
}
}

create_attribute_group(attr) = json {
json := [{"id": "yaml_schema.test", "attributes": [{"id": attr}]}]
}
Expand Down

0 comments on commit 9313ca9

Please sign in to comment.