-
Notifications
You must be signed in to change notification settings - Fork 137
DOCS-3043: Add override mechanism for known-stale upstream Felix config doc text #3019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ctauchen
merged 3 commits into
tigera:main
from
ctauchen:DOCS-3043-felix-config-overrides
Sep 9, 2026
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>" | ||
| } | ||
| ] | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
| # --- 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" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.