DOCS-2833 Add script that updates Felix config for OSS#2510
DOCS-2833 Add script that updates Felix config for OSS#2510ctauchen wants to merge 1 commit intotigera:mainfrom
Conversation
✅ Deploy Preview succeeded!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for calico-docs-preview-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Adds a new helper script to keep the Felix configuration parameter data in this docs repo synchronized with projectcalico/calico for master and versioned OSS branches (3.30+).
Changes:
- Introduces
scripts/felix-config-update.shto downloadfelix/docs/config-params.jsonfrom upstream Calico. - Updates the unversioned (master) FelixConfig data file and iterates through
calico_versions.jsonto update versioned docs, skipping 3.29.
f5c37f3 to
6eb2d7b
Compare
|
How does this script fit into your process? Do you run it regularly? Presumably the intent is that you run it and use the changes it makes to raise a PR? The script itself looks fine. |
For now, the idea is just to have this available to run manually for quick and accurate updates. So yes, run and raise a PR. I'd probably aim to run it at release time. Next steps are to include other products and fold into proper automation. But that was beyond the scope for the moment. |
scripts/felix-config-update.sh
Outdated
| @@ -0,0 +1,65 @@ | |||
| #!/bin/bash | |||
|
|
|||
| set -e/-u/pipefail | |||
There was a problem hiding this comment.
I think copilot meant that you should add at least one of the "-e/-u/pipefail" options. The actual syntax would be set -eu -o pipefail
There was a problem hiding this comment.
Yeah, I realized that after when i couldn't run the script! That's changed now.
scripts/felix-config-update.sh
Outdated
| exit 1 | ||
| fi | ||
|
|
||
| curl -o "$LOCAL_PATH" "$REMOTE_URL" |
There was a problem hiding this comment.
I always add -fsSL to my curl invocations.
-fcauses it to return an error code if it gets an HTTP error (so the script ends)-scauses it not to print the (usually pointless) progress indicator (silent)-Sshows (prints out) the error if one happened-Lfollows HTTP redirects instead of saving the redirect response
Long form is --fail --silent --show-error --location
IMHO all of these options should always be used whenever using curl in a shell script, as it catches a lot of errors that would otherwise be missed.
There was a problem hiding this comment.
That's great, thanks. Added.
|
|
||
| # Exclude version 3.29, which came before direct-from-source method. | ||
| if [ "$VERSION" == "3.29" ]; then | ||
| printf "%s\n" "Skipping $VERSION: No action required." |
There was a problem hiding this comment.
You can use echo "blah blah" instead of printf "%s\n" "blah blah" unless you're doing more complex variable printing (like trying to print values as hex or formatting a number in a specific way). Tends to be more readable.
There was a problem hiding this comment.
I got to that after having trouble with newlines. I think I'll leave it for now, but I take the point that it's cleaner with a plain echo statement.
This script updates the FelixConfiguration component with data from projectcalico/calico. Works for master and OSS 3.30+. DOCS-2833
6eb2d7b to
0208d65
Compare

This script updates the FelixConfiguration component with data from projectcalico/calico. Works for master and OSS 3.30+.
DOCS-2833
Product Version(s):
Issue:
Link to docs preview:
SME review:
DOCS review:
Additional information:
Merge checklist: