Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -6440,8 +6440,8 @@
"Required": false,
"OnParseFailure": "ReplaceWithDefault",
"AllowedConfigSources": "All",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is true.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is true.</p>",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is false.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is false.</p>",
"UserEditable": true,
"GoType": "*bool",
"OpenSourceOnly": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6440,8 +6440,8 @@
"Required": false,
"OnParseFailure": "ReplaceWithDefault",
"AllowedConfigSources": "All",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is true.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is true.</p>",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is false.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is false.</p>",
"UserEditable": true,
"GoType": "*bool",
"OpenSourceOnly": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5799,8 +5799,8 @@
"Required": false,
"OnParseFailure": "ReplaceWithDefault",
"AllowedConfigSources": "All",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is true.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is true.</p>",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is false.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is false.</p>",
"UserEditable": true,
"GoType": "*bool",
"OpenSourceOnly": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5976,8 +5976,8 @@
"Required": false,
"OnParseFailure": "ReplaceWithDefault",
"AllowedConfigSources": "All",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is true.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is true.</p>",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is false.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is false.</p>",
"UserEditable": true,
"GoType": "*bool",
"OpenSourceOnly": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6440,8 +6440,8 @@
"Required": false,
"OnParseFailure": "ReplaceWithDefault",
"AllowedConfigSources": "All",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is true.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is true.</p>",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is false.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is false.</p>",
"UserEditable": true,
"GoType": "*bool",
"OpenSourceOnly": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6440,8 +6440,8 @@
"Required": false,
"OnParseFailure": "ReplaceWithDefault",
"AllowedConfigSources": "All",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is true.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is true.</p>",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is false.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is false.</p>",
"UserEditable": true,
"GoType": "*bool",
"OpenSourceOnly": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6440,8 +6440,8 @@
"Required": false,
"OnParseFailure": "ReplaceWithDefault",
"AllowedConfigSources": "All",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is true.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is true.</p>",
"Description": "Used to enable/disable dynamically changing aggregation levels. Default is false.",
"DescriptionHTML": "<p>Used to enable/disable dynamically changing aggregation levels. Default is false.</p>",
"UserEditable": true,
"GoType": "*bool",
"OpenSourceOnly": false
Expand Down
18 changes: 18 additions & 0 deletions scripts/felix-config-overrides.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"field": "FlowLogsDynamicAggregationEnabled",
"reason": "felix/config/config_params.go tags this field `bool;false` (unchanged across all versions), but the doc comment in api/pkg/apis/projectcalico/v3/felixconfig.go has always said 'Default is true.' -- a long-standing stale comment, not a behavior change. Corrected on tigera/calico-private master via PR #12538 (merged 2026-07-16, incidental to an unrelated fluentd-removal change) but not yet backported to any release branch. Remove this entry once a synced file no longer needs it -- a WARNING below will announce that automatically.",
"patches": [
{
"key": "Description",
"expected": "Used to enable/disable dynamically changing aggregation levels. Default is true.",
"value": "Used to enable/disable dynamically changing aggregation levels. Default is false."
},
{
"key": "DescriptionHTML",
"expected": "<p>Used to enable/disable dynamically changing aggregation levels. Default is true.</p>",
"value": "<p>Used to enable/disable dynamically changing aggregation levels. Default is false.</p>"
}
]
}
]
79 changes: 79 additions & 0 deletions scripts/patch-felix-config-overrides.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash

# Patches known-stale upstream Felix config doc text into a freshly-synced
# config-params.json, in place. Overrides are declared in felix-config-overrides.json,
# scoped by NameConfigFile so a patch can never touch an unrelated field that happens
# to share the same description text.
#
# Called from update_felix_config() in update-felix-config.sh, after the fetched file
# has been validated as JSON and before it replaces the checked-in copy.

set -euo pipefail

readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly OVERRIDES_FILE="${SCRIPT_DIR}/felix-config-overrides.json"

target=$1
patched=""

cleanup() {
[[ -n "$patched" && -f "$patched" ]] && rm -f "$patched"
}
trap cleanup EXIT

if [[ ! -f "$OVERRIDES_FILE" ]]; then
echo "Error: overrides file not found: $OVERRIDES_FILE" >&2
exit 1
fi

if ! jq -e . "$OVERRIDES_FILE" >/dev/null 2>&1; then
echo "Error: $OVERRIDES_FILE is not valid JSON." >&2
exit 1
fi
Comment thread
Copilot marked this conversation as resolved.

# --- Report what each override did: applied, already unnecessary, or no longer matches ---
while IFS=$'\t' read -r status field key reason; do
case "$status" in
patched)
echo "NOTICE: patched ${field}.${key} (${reason})"
;;
already-correct)
echo "WARNING: override for ${field}.${key} is a no-op -- upstream text already matches. Safe to remove from ${OVERRIDES_FILE}. (${reason})" >&2
;;
stale)
echo "WARNING: override for ${field}.${key} did not apply -- upstream text matches neither the known-buggy nor the corrected value. Needs review in ${OVERRIDES_FILE}. (${reason})" >&2
;;
esac
done < <(jq -r --slurpfile overrides "$OVERRIDES_FILE" '
$overrides[0] as $ovs
| [ .Groups[].Fields[] as $f
| $ovs[] as $ov
| select($ov.field == $f.NameConfigFile)
| $ov.patches[] as $p
| ($f[$p.key]) as $cur
| { status: (if $cur == $p.expected then "patched"
elif $cur == $p.value then "already-correct"
else "stale" end),
field: $ov.field, key: $p.key, reason: $ov.reason }
]
| .[]
| [.status, .field, .key, .reason] | @tsv
' "$target")

# --- Apply the patches: field-scoped by NameConfigFile, key-scoped by an expected-value guard ---
patched=$(mktemp -t felix-config-patched.XXXXXX)
jq --slurpfile overrides "$OVERRIDES_FILE" '
$overrides[0] as $ovs
| .Groups |= map(.Fields |= map(
. as $f
| reduce ($ovs[] | select(.field == $f.NameConfigFile)) as $ov
( $f
; reduce ($ov.patches[]) as $p
( .
; if (.[$p.key] == $p.expected) then .[$p.key] = $p.value else . end
)
)
))
' "$target" > "$patched"

mv "$patched" "$target"
2 changes: 2 additions & 0 deletions scripts/update-felix-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ update_felix_config() {
exit "$E_INVALID_JSON"
fi

"$(dirname "${BASH_SOURCE[0]}")/patch-felix-config-overrides.sh" "$tmpfile"

mv "$tmpfile" "$LOCAL_PATH"
echo -e "Finished processing ${VERSION}.\n\n"
}
Expand Down