Fix jq $def keyword collision in optional-integrations-load

The agent-policy enumeration passed --argjson def, creating a jq
variable $def. 'def' is a reserved keyword in jq and the deployed jq
version rejects it, so the program failed to compile and
in_use_integrations was left empty (silently disabling the in-use
upgrade guard). Rename the arg to $defaults.
This commit is contained in:
Josh Patterson
2026-06-11 15:50:53 -04:00
parent 6c42c419e2
commit b1273573ed
@@ -53,8 +53,8 @@ for AGENT_POLICY in $agent_policies; do
# non-default integrations that are in-use in any policy
while IFS= read -r PACKAGE_NAME; do
[ -n "$PACKAGE_NAME" ] && in_use_integrations+=("$PACKAGE_NAME")
done < <(jq -r --argjson def "$default_packages_json" \
'.item.package_policies[].package.name | select(. as $n | ($def | index($n)) | not)' \
done < <(jq -r --argjson defaults "$default_packages_json" \
'.item.package_policies[].package.name | select(. as $n | ($defaults | index($n)) | not)' \
<<<"$policy_json")
done