Resolve ovnkube node encap IP in startup script#2998
Conversation
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughTwo shell helpers are added to resolve encapsulation IP, and ChangesEncapsulation IP Resolution
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: SchSeba The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bindata/network/ovn-kubernetes/common/008-script-lib.yaml`:
- Around line 544-547: Normalize and trim whitespace from the OVN_ENCAP_IP
environment variable before constructing ovn_encap_ip_flag: create a trimmed
value (e.g., strip leading/trailing whitespace from OVN_ENCAP_IP), check that
the trimmed value is non-empty, then set
ovn_encap_ip_flag="--encap-ip=${TRIMMED_OVN_ENCAP_IP}" and log the trimmed
value; update uses of OVN_ENCAP_IP to reference the trimmed variable so
accidental surrounding whitespace won't produce an invalid or split --encap-ip
argument.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ed7676fc-f101-424f-bb21-db5380f271b0
📒 Files selected for processing (1)
bindata/network/ovn-kubernetes/common/008-script-lib.yaml
| if [[ -n "${OVN_ENCAP_IP}" ]]; then | ||
| log "encapip" "Using OVN_ENCAP_IP override ${OVN_ENCAP_IP}" | ||
| ovn_encap_ip_flag="--encap-ip=${OVN_ENCAP_IP}" | ||
| fi |
There was a problem hiding this comment.
Normalize OVN_ENCAP_IP before building the flag.
At Line 544, OVN_ENCAP_IP is used verbatim. Accidental whitespace in env overrides can produce an invalid/split --encap-ip argument at runtime.
Suggested patch
- if [[ -n "${OVN_ENCAP_IP}" ]]; then
- log "encapip" "Using OVN_ENCAP_IP override ${OVN_ENCAP_IP}"
- ovn_encap_ip_flag="--encap-ip=${OVN_ENCAP_IP}"
+ local encap_ip_override="${OVN_ENCAP_IP//[[:space:]]/}"
+ if [[ -n "${encap_ip_override}" ]]; then
+ log "encapip" "Using OVN_ENCAP_IP override ${encap_ip_override}"
+ ovn_encap_ip_flag="--encap-ip=${encap_ip_override}"
fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if [[ -n "${OVN_ENCAP_IP}" ]]; then | |
| log "encapip" "Using OVN_ENCAP_IP override ${OVN_ENCAP_IP}" | |
| ovn_encap_ip_flag="--encap-ip=${OVN_ENCAP_IP}" | |
| fi | |
| local encap_ip_override="${OVN_ENCAP_IP//[[:space:]]/}" | |
| if [[ -n "${encap_ip_override}" ]]; then | |
| log "encapip" "Using OVN_ENCAP_IP override ${encap_ip_override}" | |
| ovn_encap_ip_flag="--encap-ip=${encap_ip_override}" | |
| fi |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@bindata/network/ovn-kubernetes/common/008-script-lib.yaml` around lines 544 -
547, Normalize and trim whitespace from the OVN_ENCAP_IP environment variable
before constructing ovn_encap_ip_flag: create a trimmed value (e.g., strip
leading/trailing whitespace from OVN_ENCAP_IP), check that the trimmed value is
non-empty, then set ovn_encap_ip_flag="--encap-ip=${TRIMMED_OVN_ENCAP_IP}" and
log the trimmed value; update uses of OVN_ENCAP_IP to reference the trimmed
variable so accidental surrounding whitespace won't produce an invalid or split
--encap-ip argument.
Teach the ovnkube node wrapper to derive --encap-ip from /etc/ovnk/encap_interface, including host-mounted lookups and dual-stack addresses, while allowing OVN_ENCAP_IP to override the resolved value for per-node configuration. Signed-off-by: Sebastian Sch <sebassch@gmail.com>
55250eb to
71961a6
Compare
|
@SchSeba: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Teach the ovnkube node wrapper to derive --encap-ip from /etc/ovnk/encap_interface, including host-mounted lookups and dual-stack addresses, while allowing OVN_ENCAP_IP to override the resolved value for per-node configuration.
Summary by CodeRabbit
--encap-ipusing a local configuration file, with support for environment variable overrides.--encap-ipargument when launchingovnkube, improving correctness and flexibility for encapsulation address selection.