Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions internal/testrunner/runners/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ var policyEntryFilters = []policyEntryFilter{
{name: "data_stream.elasticsearch", onlyIfEmpty: true},
}},
}},

// Fields present since 9.3.0.
{name: "inputs", elementsEntries: []policyEntryFilter{
{name: "meta.package.policy_template"},
{name: "meta.package.release"},
}},
}

var uniqueOtelComponentIDReplace = policyEntryReplace{
Expand Down Expand Up @@ -321,6 +327,9 @@ func cleanPolicyMap(policyMap common.MapStr, entries []policyEntryFilter) (commo
return policyMap, nil
}

// isEmpty checks if the value is empty. It is considered empty if it is the zero value,
// or for values for length, if it is zero. Values in ignoreValues are not counted for
// the total length when present in lists.
func isEmpty(v any, ignoreValues []any) bool {
switch v := v.(type) {
case nil:
Expand Down
2 changes: 2 additions & 0 deletions internal/testrunner/runners/policy/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ inputs:
package:
name: sql_input
version: 1.0.0
release: ga
policy_template: sql_input
name: test-mysql-sql_input
package_policy_id: b2775cd2-185c-11ef-bf70-b7bd5adaa788
streams:
Expand Down