Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove fields added in policies for input packages in 9.1
  • Loading branch information
jsoriano committed Aug 1, 2025
commit 20b0fcc1cb4f6367e1ea3054fe7a1f0dcaf17eb5
12 changes: 12 additions & 0 deletions internal/testrunner/runners/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ var policyEntryFilters = []policyEntryFilter{

// Namespaces may not be present in older versions of the stack.
{name: "namespaces", onlyIfEmpty: true, ignoreValues: []any{"default"}},

// Values set by Fleet in input packages starting on 9.1.0.
{name: "inputs", elementsEntries: []policyEntryFilter{
{name: "streams", elementsEntries: []policyEntryFilter{
{name: "data_stream.type"},
{name: "data_stream.elasticsearch.dynamic_dataset"},
{name: "data_stream.elasticsearch.dynamic_namespace"},
{name: "data_stream.elasticsearch", onlyIfEmpty: true},
}},
}},
}

// cleanPolicy prepares a policy YAML as returned by the download API to be compared with other
Expand Down Expand Up @@ -239,6 +249,8 @@ func isEmpty(v any, ignoreValues []any) bool {
return len(filterIgnored(v, ignoreValues)) == 0
case map[string]any:
return len(v) == 0
case common.MapStr:
return len(v) == 0
}

return false
Expand Down